Programming/Non programming

Tuesday, April 13, 2010

iPhone OS 4.0

iPhone OS 4.0 features:


Pre-requisites:
     - iPhone SDK 4 beta requires Mac OS X v10.6.2 or later.
     - This software should only be installed on devices dedicated exclusively for iPhone OS 4 beta
        application development.
     - iPhone SDK 4 beta cannot be used for submitting applications to the App Store
     - iPhone OS 4 will only work with iPhone 3G, iPhone 3GS and 2nd, 3rd generation iPod touch. Not
       all features are compatible with all devices. Multitasking is available only with iPhone 3GS and 3rd
       Generation iPod touch.


Apple introduces excellent and nice features support in OS 4.0. Beta version of 4.0 SDK is currently available from developer.apple.com website, only for registered developers. This version supports to run only on iPhone and iPod, not on iPad.

Below are the brief explanations about iPhone OS 4.0 features.

I. Multi tasking

i)  Application can now able to run in the background from 4.0 onwards.
ii) Many of the tasks that you want to execute can now continue even after exiting the application to home screen.
iii) Background applications can still got terminated in certain cases like low-memory etc.
iv) NOTE: It is not supported for all the iPhone OS devices. If a device is not running iPhone OS 4.0 and later, or if the hardware is not capable of running applications in the background, the system reverts to the previously defined behavior for handling applications.
v) Multitasking is available only with iPhone 3GS and 3rd Generation iPod touch.
vi) The following are the seven multitasking is supported with this new SDK:
     -> Background Audio - Allows to run your audio continuously even after exit the application.
     -> Voice over IP - Allows to have VoIP calls and have conversation while using other apps.
     -> Background location - Monitor location when user moves between cell towers.
     -> Push notifications - Receive alerts from your remote servers even when your app is not running.
     -> Local Notifications - Alert user in schedules events and alarms using local notifications.
     -> Task finishing (after exiting your app too..) - App can keep running to finish the tasks even after
                                                                                 exit your app.
     -> Fast App Switching - Allow to leave your app and come right back to where you left.

II. Notifications

i) Existing push notifications which is relying on external server is not needed hereafter from 4.0 and generating the notifications locally is being possible with this new SDK.
ii) Scheduled notification is being possible with this new SDK.
iii) For setting notifications, your application is not needed to be running.

III. Event Kit

i)   It gives access to built-in Calendar events using through EventKit.framework.
ii)  It gives access to scheduled alarms and edit existing events.
iii) For editing and viewing events, Event Kit has provided EventKitUI.framework.

IV. Data Protection

  Data encryption/decryption option has provided during lock/unlock.

V. Core Telephony

i)  Cellular-radio based phone information can be interacted using CoreTelephony.framework.
ii) Cellular call notifications and get service provider information are all possible now.

VI. iAd

i)   You can use deliver-modal and banner-based advertisements in your application using this AdLib.framework.
ii)  One more advantage of this is, after showing Advertisements in browser (launched from your app), it will be able to then again come back to your application safely with the last interaction.
iii) You need to register with Apple's Ad service for this.

VII. Graphics and Multimedia

- Quick Look Framework:

  To show your downloaded contents in this framework view controller directly after downloading it from the network using QuickLook.framework.

- AV Foundation: (AVFoundation.framework)

i) It has been expanded from 3.0 SDK. It includes advanced features such as:

   Media editing,
   Movie capture,
   Movie playback (after exiting your applications too),
   Track management

- Assets Library:

  Assets Library framework (AssetsLibrary.framework) provides access to users' photos, videos, saved photos album.

- Image I/O: (ImageIO.framework)

   Give access to import and export image data and image metadata.

- Core Media: (CoreMedia.framework)
  
    It provides a low-level C interface for managing and playing audio-visual media in your application.

- Core Video: (CoreVideo.framework)

   It provides buffer and buffer pool support for Core Media.


Please read the http://developer.apple.com/ to have more informations on this and download the SDK.



Cheers!

M.P.Prabakar
Senior Systems Analyst.


Have fun and be addictive by playing "TossRing" marvelous iPhone game. Link is below..

iPhone:Animate gif image in program

iPhone: 


How to animate an animated or non-animated Gif or any other images on iPhone development

Point to remember:

There is no possibility to directly apply an animated Gif or any other image in project resource and call UIImageView to animate it.

How do we achieve it?

There is a UIImageView property called 'animationImages', using which we can pass array of image frames and animated it as same as seeing gif animation on browser.

Steps:

1. Get your required animated gif image. Use some tools to extract that animated gif image to frame by frame images. I used Mac->Preview to launch my animated gif image, it will automatically show frames of images, choosing each one and do Save As to have frame of images in JPG format.

2. Add all the frame of gif images into your project resource folder in Xcode.

3. create an UImageView in your application screen.

4. Use the following code to make the animation:


UIImageView *myImageView;

myImageView.animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:firstImgStr],[UIImage imageNamed:secondImgStr], [UIImage imageNamed:thirdImgStr], [UIImage imageNamed:fourthImgStr], nil];

myImageView.animationDuration = 1.0f;
myImageView.animationRepeatCount = 0;
[myImageView startAnimating];
[myImageView release];


Run this code and you can see the animated gif doing animation on screen in your UImageView.
Note: I added just four frame of images there such as firstImgStr, secondImgStr etc. you can add how many frame of images that you require. 





Cheers!

M.P.Prabakar
Senior Systems Analyst.

Have fun and be addictive by playing "TossRing" marvelous iPhone game. Link is below..