Friday, October 15, 2010

Display Image in Imageview from any remote url

Display Image in Imageview from any remote url::

here

musicImage is a string which contain url.
and musicThumbnail is a imageview.


NSURL *imageURL = [NSURL URLWithString:musicImage];
NSData *data = [NSData dataWithContentsOfURL:imageURL];
UIImage *image = [[UIImage alloc] initWithData:data];
[musicThumbnail setImage:image];

Sunday, September 26, 2010

Use blutooth device for your own app

Hi,
Last days i got lot of appreciation about my blog from students of spymek..thanks to all and thanks to ravi sir.
This time i am focusing on new concept to connect blutooth device to your own apps. I think you all poeple knows that whnever we connect any bluetooth device to our iphone or ipad it will work for all native application only..but if we want to use it for our own apps we have to connect it we have ti implement BTstack for that.
The code is available on google code.lets have a look at what google says about it.
""The aim of this project is to support devices for which the OS either does not provide a Bluetooth Stack or the available stack is severely limited (e.g., on the iPhone).

It provides a portable Bluetooth Stack that runs as a user-space daemon and will support different Bluetooth HCI transport layers (e.g., HCI H4 UART and H5 the "Tree-Wire" protocol), different inter-process communication methods, and support multiple applications in parallel.

It is not a port of an existing Bluetooth Stack. However, best practices from the Bluetooth Stack used in the BTnode Project at ETH Zurich and others are incorporated. ""


Lets look at this video :http://www.youtube.com/watch?v=WFWjVkzJb_s


You can found all your code on this link..http://code.google.com/p/btstack/


Waiting for your valuable commments.

Sunday, August 29, 2010

Working with core telephony framwork



Hi,
from last two days i am working on core Telephony framwork...1st of all i tried with iphone 3gs and i found that there is only 3 methods available..as follows
- (void)applicationWillResignActive:(UIApplication *)application
- (void)applicationDidBecomeActive:(UIApplication *)application
- (void)applicationWillTerminate:(UIApplication *)application
In applicationWillResignActive we can identify incoming call while we working on any application but the thing is that here it will take any inturrupt as a input.for e.g. if we are working on any application and if call comes it will detect it and we can set any pop-up on that but this fails when you set any alarm and if it activate in beetween this it will also generate interupt and also allow pop-up that u defined for detecting incoming calls.
Till iphone 3gs its totally useless to work on this method..here apple is not providing any methods to work on telephone and neither permit to do it by using any external methods.


All the blog publish by erica and others available only shows this three methods but if you have documentation of iphone os4.0 then you found core telephony framwork to work on this.

we have following methods in core telephony framework which with you can work.

You have to include these headers file in your code
1)CTCall.h

in these you found following methods
a)callID property
A unique identifier for the cellular call. (read-only)
b)callState property
The state of the cellular call. (read-only)

2)CTCallCenter.h

a)callEventHandler property
Dispatched when a call changes state.
b)currentCalls property
An array representing the cellular calls in progress. (read-only)

3)CTCarrier.h

a)allowsVOIP property
Indicates if the carrier allows VoIP calls to be made on its network. (read-only)

b)carrierName property
The name of the user’s home cellular service provider. (read-only)

c)isoCountryCode property
The ISO country code for the user’s cellular service provider. (read-only)

d)mobileCountryCode property
The mobile country code (MCC) for the user’s cellular service provider. (read-only)

e)mobileNetworkCode property
The mobile network code (MNC) for the user’s cellular service provider. (read-only)

4)CTTelephonyNetworkInfo.h

a)subscriberCellularProvider property
Information about the user’s cellular service provider. (read-only)

b)subscriberCellularProviderDidUpdateNotifier property
Dispatched when the user’s cellular service provider information changes.


You will find all the details of this methods on developer.apple.com.

--- This blog was written long time back and source code that i have is not compatible with latest SDK, Please do not send request for source code. I know its sound rude but please.:)--

Hope this information is usefull for you people...Happy blogging..

Thursday, August 12, 2010

Interview questions part 2

Hi,
guys,
toady i had face a interview for the post of iPhone developer...following question were asked while interviewing me.
1) What is delegate?
2)what is the use of @synthesize?
3)what is retain and release?
4)what is the differance beetween pass by value and pass by reference?
5)Few question on my iphone project..
6)What is navigation controller?
7)getter and setter method?
8)what is @synchronize?
9)what is free and alloc?
ask some example on this.
10)what is deep copy and shallow copy?
11)function of section,row and row at index?
12)what will be output if section=2 and row=4?
13)how to run audio and video in iphone?which framework is used for this?
14)function overloading and overriding?
15)what is class?difference beetween class and structure?
16)Write a program, if u have two classes A and B. A contain some class and instance method and you have to invoke this method in B.
Do it without using inheritance?
17)How many touches events are there? explain it?
18)[class obj]
[obj retain]
[obj retain]
[obj release]
dealloc
{
}
what is the retain count?
and when dealloc will be called?

and finally i cracked this interview and got selected.
BEST luck

Saturday, August 7, 2010

Iphone interview question part 1


What is iPhone?

  • IPhone is a combination of internet and multimedia enabled smart phone developed by Apple Inc.
  • iPhone functions as a camera phone, including text messaging, and visual voice mail
  • iPhone is a portable media player that resembles a video iPod
  • It has user interface that is built around the multi-touch screen including virtual keyboard.
  • App Store , which launched in the mid 2008 has over 1,00,000 applications with functionalities including games, references, GPS navigation, advertising, television shows, films, reference, celebrities.

v What are the features of iphone 3gs?

Video: Videos can be edited, shared. High quality VGA video can be shot in portrait or landscape.

3 Megapixel Camera: Still photos with greater quality can be taken

Voice control: It recognizes the names in contacts and recognizes the music on iPod.

Compass: iPhone 3GS has built-in digital compass, used to point the way.

Internet Tethering: Internet surfing can be done from anywhere. A 3G connection can be shared on Iphon3 with Mac notebook or laptop..

v What is iphone OS?

iPhone OS runs on iPhone and iPod touch devices.

Hardware devices are managed by iPhone OS and provides the technologies needed for implementing native applications on the phone.

The OS ships with several system applications such as Mail, Safari, Phone, which provide standard services to the user.

v What is iphone sdk?

iPhone SDK is available with tools and interfaces needed for developing, installing and running custom native applications.

Native applications are built using the iPhone OS’s system frameworks and Objective-C language and run directly on iPhone OS.

Native applications are installed physically on a device and can run in presence or absence of network connection.

v What is iphone architecture?

It is similar to MacOS X architecture

It acts as an intermediary between the iPhone and iPod hardware an the appearing applications on the screen

The user created applications never interact directly with the appropriate drivers, which protects the user applications from changes to the hardware.

v What is iphone reference library?

iPhone reference library is a set of reference documents for iPhone OS .

It can be downloaded by subscribing to the iPhone OS Library doc set.

Select Help>Documentation from Xcode, and click the subscribe button next to the iPhone OS Library doc set, which appears in the left column.

v What are sensors in iphone?

The proximity sensor immediately turns off the display when the iPhone is lifted to ear. With this sensor the power is saved and accidental dialing is prevented.

The display is automatically brightens the iPhone by the ambient light sensor when the sunlight or bright rooms and dims in darker places.

v What are the location services?

Applications such as Maps, camera and compass are allowed to use the information from cellular, Wi-Fi and Global Positioning System networks for determining the approximate locations.

The location is displayed on the screen, using a blue marker.

v Describe the functionality of accelerometer of an iphone

iPhone responds to motion using a built-in accelerometer.

The accelerometer detects the movement and changes the display accordingly, at the time of rotating iPhone from portrait to landscape.

v Explain about the applications that can be used with iphone

Technology, Entertainment and Design(TED): Allows to watch and listen to world’s most fascinating people have to say, all on the iPhone.

Market Watch: Breaking news about the investments can be seen. To do so, open the Stocks app and rotate.

Trends: Latest runway shows, videos from Vogue’s fashion library, reviews, exclusive party pictures, fashion news updates can be seen on Style.com


about my blog

Hi,
All
Here i am posting some interview questions and facts about iphone that will be necessary while preparing for any iphone developer for interview...The credit of this blog goes to all those website from which i had copied this stuff..my intention behind this is only to avail all stuff at one location..If You have Any data regarding this send it to me or keep posting it in comment section..
expecting great response in future..

Thanks
sparsh