Programming/Non programming

Monday, March 31, 2014

Android build error: Call requires API level 14 current min is 8 ...

Android:


Issue

Call requires API level 14 current min is 8 ...

Solution:
It is due to API version level issue. You added latest API, but your program couldn't find it to support for multiple versions, even though you have that version SDK installed.

So,

Just add @SuppressLint("NewApi") just before onCreate() method.

For example like this:

@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // TODO Auto-generated method stub
    setContentView(R.layout.myActivity);

}

Thank you!

Cheers!

Prabakar

Android build error: R cannot be resolved

Android:


Issue:

R cannot be resolved

Solution:

When I observed "R cannot be resolved" error with the most of the existing solution given, i found making sure, all the res/* filenames should be named with lowercase character, underscore and number between 0 and 9, was the typical fix for me.


Thank you!

Cheers!

Prabakar

Sunday, March 9, 2014

How to solve device not shown when installing Android app on the device through Eclipse development?

How to solve device not shown when installing Android app on the device through Eclipse development?

Issue:

Device is not listed when installing Android project on the Android device via Eclipse development using "Run As"/"Debug As" option.

Solution:

One of the important solutions for this issue is, Go to your Android device "Settings -> Developer Options-> USB Debugging" and enable it.


Saturday, March 8, 2014

How to Debug An Android application through Eclipse?

How to Debug An Android application through Eclipse?

1. Open "AndroidManifest.xml" of your Android project in Eclipse.
2. Choose "Application" tab
3. Change "Debuggable" option as "true"

4. Go to your project source files and identify the lines where you want to debug, and add break point by enabling "Toggle breakpoint" from "Run" menu (or) Right click the left most area in the source file to enable "Toggle breakpoint" option.
5. Right click project "Debug As" -> "Android Application"

When the application is running, automatically it will stop at debug points. You can verify logs in LogCat.

Hope, it will help someone!

Thank you Guys!

Regards,

Prabakar. M.P

Technical Architect




How to stop the android application running on the device through eclipse

Stopping android app:

When you are running your android application in the emulator of Android, you always can stop it by closing the emulator. But, to stop it running on the device through Eclipse, you can find the better following way,

1. On the top right side of Eclipse, you can see an icon with the symbol of Andoid and some character "DDMS". Press it.
You can do the same pressing:
Windows -> Open perspective -> Other... -> DDMS

2. In the Android view, on the left windows, you can see "Devices". There should be a list of applications that is running now (Emulator or physical devices).
Click on the application you want to close. 
3. Now click on the symbol of "Stop".

To come back to the normal view, you just have to press on the Java button on the top right side.
You can also do it pressing:
Windows -> Open perspective -> Other... -> Java 

Hope it finds some help to someone :)

Cheers,

-Prabakar M.P
Technical Architect.

Thursday, April 25, 2013

Make iOS 6.x devices to detect in Xcode 4.x in Snow Leopard

Hi,

The issue basically have been found is, we can't get the iPhone or iPad 6.x devices connected actively in Xcode 4.x versions in Snow Leopard 10.6.x version Mac's. These version devices won't be able to get detected in Xcode 4.x versions in Snow Leopard.

The actual solution would be, we have to download respective Xcode 4.5.x versions and install on the Mac and get these devices detected.

To reduce all these procedures every time to download and install, the below approach would be easier and way of hack to get such version iOS 6.x devices can be detected in Xcode older 4.x version or older.

Shortcut procedure would be,

1. Go to any machine where Xcode 4.5 or 4.6 installed
    (or)
    Download Xcode 4.5 ot 4.6 version setup (.DMG) from Downloads for Apple Developers.

2. If you find .dmg setup, run it, it will be open Xcode.app in an view

3. Right click this xcode.app and choose 'Show Package Contents'

4. Go to this path and copy
     Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/6.x (9B176)

[Here, it is mentioned '/DeviceSupport/6.x', you can choose whichever 6.x version you want]

5. Place (paste) these files in this path:  /Developer/Platforms/iPhoneOS.platform/DeviceSupport
 on your machine directry.

6.  Also, copy 'version.plist' from "Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform"  to your Snow Leopard machine directory in the same path.

7. Also, copy 6.x SDK folder and paste it in current system same SDK path. For ex: Copy sdk path from,  Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk and paste in your machine in the same path

8. Re-start Xcode on your Snow Leopard machine

9. Connect your iOS 6.x version device

You can see Xcode lower version 4.2 like that, will be able to detect iOS 6.x device and show in your Xcode. Let me know if any issues, i'll sort it out!

Cheers!

Prabakar.


Thursday, March 21, 2013

Solve Xcode iOS Project Set as "My Mac 64-bit"

Issue:

Sometime we may observe that the iOS based Xcode project is shown with "My Mac 64-bit"/"My Mac 32-bit" Mac OS X Destination in Xcode instead of "iPhone/iPad Simulator/Device" Settings.

Solution 1:

1. Right click your particular Xcode project file, "myproject.xcodeproj" and choose "Show Package Contents"
2. Delete all the files from "xcuserdata"

Solution 2:
Sometimes changing the target to iPhone/iPad device solves this issue.

You are ready to get "iPhone/iPad Simulator/Device" Destination Settings in Xcode project.

Solution 3:
You may have selected wrong deployment device target in the build settings. So, make sure to select the right device deployment target.

Cheers!

-Prabakar.M.P.

Wednesday, September 12, 2012

iOS 6 features for developers


iOS 6.0
This article summarizes the key developer-related features introduced in iOS 6. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features in more detail.
For late-breaking news and information about known issues  see iOS 6 Doc       For the complete list of new APIs added in iOS 6, see iOS 6.0 Api Diff Doc
Maps
In addition to the new map tiles provided by Apple, the Maps app and MapKit framework now support additional interactions with other apps. Apps that do not incorporate their own map support now have an easier way to launch the Maps app and display points of interest or directions. Apps that offer routing information, such as turn-by-turn navigation services, can now register as a routing app and make those services available to the entire system.
Registering as a routing app gives you more opportunities to get your app in front of users. Routing apps are not limited to just driving or walking directions. Routing apps can also include apps that provide directions for the user’s favorite bicycle or hiking trail, for air routes, and for subway or other public transportation lines. And your app does not even have to be installed on the user’s device. Maps knows about routing apps in the App Store and can provide the user with the option to purchase those apps and use them for directions.
Apps that do not provide routing directions themselves can also take advantage of both Maps and routing apps. Apps can use new interfaces to ask the Maps app to display specific locations or to display routing directions between two locations.

Social Framework
The Social framework (Social.framework) provides a simple interface for accessing the user’s social media accounts. This framework supplants the Twitter framework that was introduced in iOS 5 and adds support for other social accounts, including Facebook and Sina’s Weibo service. Apps can use this framework to post status updates and images to a user’s account. This framework works with the Accounts framework to provide a single sign-on model for the user and to ensure that access to the user’s account is approved.
The UIKit framework also provides a new UIActivityViewController class for displaying actions that the user might perform on some selected content. One use of this class is to allow the user to post content to social accounts, such as Twitter or Facebook. You present this class modally on iPhone or using a popover controller on iPad. When the user taps one of the buttons, the view controller presents a new interface to perform the associated action.
Pass Kit
Pass Kit is a new technology that uses web services, a new file format, and an Objective-C framework (PassKit.framework) to implement support for downloadable passes. Companies can create passes to represent items such as coupons, boarding passes, event tickets, and discount cards for businesses. Instead of carrying a physical representation of these items, users can now store them on their iOS device and use them the same way as before.
Passes are created by your company’s web service and delivered to the user’s device via email, Safari, or your custom app. The pass itself uses a special file format and is cryptographically signed before being delivered. The file format identifies relevant information about the service being offered so that the user knows what it is for. It might also contain a bar code or other information that you can then use to validate the card so that it can be redeemed or used.
Game Center
Game Center has been updated and new features have been added to improve the game playing experience. The Game Kit framework (GameKit.framework) includes the following incremental and major changes:
Challenges allow a player to challenge a friend to beat an achievement or score. Players can issue challenges from the Game Center app. You can also use the GKChallenge class to issue challenges from within your game.
The GKGameCenterViewController class incorporates all of the previous capabilities of the leaderboard, achievement and friend request view controllers. You can use the previous view controllers too, but they now present the appropriate tab in the game center view controller.
The process for authenticating a local player has changed. In the new process, you set the authenticateHandler property to a block and call the authenticate method. Game Kit no longer displays the authentication interface directly. Instead, your app is asked to present an appropriate authentication view controller, giving you more control over the authentication process.
The turn-based match class now has support for player timeouts. When using a timeout, you specify a list of players in order. If a player times out, the next player in the list is asked to take a turn instead.
The GKMatchmaker class has been updated to include better support for programmatic matchmaking. It is now easier to implement your own user interface for matchmaking on top of Game Center’s built-in support.
The GKPlayer class now supports display names for players.
The GKMatch class provides a method to estimate which player has the best connection to Game Center. You can use this method when implementing your own client-server architecture on top of the GKMatch infrastructure.
The GKAchievement class now allows multiple achievements to be submitted at the same time.
Reminders
The Event Kit framework now includes interfaces for creating and accessing reminders on the user’s device. The reminders you create show up in the Reminders app along with ones created by the user. Reminders can include proximity or time-based alarms.
In-App Purchase
The Store Kit framework (StoreKit.framework) now supports the purchasing of iTunes content inside your app and provides support for having downloadable content hosted on Apple servers. With in-app content purchases, you present a view controller that lets users purchase apps, music, books, and other iTunes content directly from within your app. You identify the items you want to make available for purchase but the rest of the transaction is handled for you by Store Kit.
Prior to iOS 6, you were responsible for managing any downloadable content made available through in app purchase. Hosted downloads now simplify the work you need to do to make content available to users. The new SKDownload class represents a downloadable piece of content. In addition, the SKPaymentTransaction class has been modified to provide an array of download objects for any hosted content. To download a piece of content, you queue a download object on the payment queue. When the download completes, your payment queue observer is notified.
Collection Views
The UICollectionView class offers a new way to present ordered data to users. With a collection view object, you are now able to define the presentation and arrangement of embedded views. The collection view class works closely with an accompanying layout object to define the placement of individual data items. UIKit provides a standard flow-based layout object that you can use to implement multi-column grids containing items of standard or varying sizes. And if you want to go beyond grid layouts, you can create your own custom layout objects to support any layout style you choose.
Collection views work with a dedicated group of classes to support the display of items. In addition to cells, collection views can have supplementary views and decoration views. The usage and placement of these views is controlled entirely by the layout object. For example, the flow-based layout object uses supplementary views to implement header and footer views for sections in the collection view.
Other noteworthy features of collection views include:
A UICollectionViewController class for managing the presentation of collection views in your app
Support for animating content within the collection view
Batch support for inserting, moving, and deleting items
A simplified model for creating and managing cells and other views
For more information about the new collection view classes, see UIKit Framework Reference.
UI State Preservation
State preservation makes it easier for apps to restore their user interface to the state it was in when the user last used it. Prior to iOS 6, apps were encouraged to write out information about their current interface state in the event that the app was terminated. Upon relaunch, the app could use this state to restore its interface and make it seem as if the app had never quit. State preservation simplifies this process by providing you with all of the core infrastructure for saving and restoring your app’s interface.
Implementing state preservation still requires effort on your part to identify what parts of your interface to save. In addition, the preservation and restoration processes can be customized to accommodate unforeseen circumstances, such as missing content during a subsequent relaunch or changes to your app’s UI.

Auto Layout
Auto layout improves upon the “springs and struts” model previously used to lay out the elements of a user interface. With auto layout, you define rules for how to lay out the elements in your user interface. These rules express a larger class of relationships and are more intuitive to use than springs and struts.
The entities used in Auto Layout are Objective-C objects called constraints. This approach brings you a number of benefits:
Localization through swapping of strings alone, instead of also revamping layouts.
Mirroring of user-interface elements for right-to-left languages like Hebrew and Arabic.
Better layering of responsibility between objects in the view and controller layers.
A view object usually knows best about its standard size and its positioning within its superview and relative to its sibling views. A controller can override these values if something nonstandard is required.

Data Privacy
In addition to location data, the system now asks the user’s permission before allowing third-party apps to access certain user data, including:
Contacts
Calendars
Reminders
Photo Library
For contact, calendar, and reminder data, your app needs to be prepared to be denied access to these items and to adjust its behavior accordingly. If the user has not yet been prompted to allow access, the returned structure is valid but contains no records. If the user has denied access, the app receives a NULL value or no data. If the user grants permission to the app, the system subsequently notifies the app that it needs to reload or revert the data.
For the photo library, the existing interface supports the app being denied access.
Your app can provide a description for how it intends to use the data in its Info.plist file. That data is then displayed to the user when the system needs to prompt for access.
Additional Framework Enhancements
In addition to the items discussed in the preceding sections, the following frameworks have additional enhancements. 
UIKit Framework
The UIKit framework (UIKit.framework)includes the following enhancements:
UIKit now supports state preservation for your app’s user interface; see “UI State Preservation.”
Views now support constraint-based layout; see “Auto Layout.”
The UICollectionView class (and its supporting classes and protocols) support the presentation of ordered collections of items; see “Collection Views.”
UITextView and UITextField now support styled text using attributed strings.
UIKit now includes support for drawing NSAttributedString and NSMutableAttributedString objects. In addition, string-based views now support attributed strings for content.
Accessibility support has been improved to include new VoiceOver enhancements:
VoiceOver can now use gestures to trigger specific actions.
Developers can order items together in the element list that VoiceOver creates to provide a more logical flow from element to element.
Scroll views can now provide a special status string during scrolling.
You can now post notifications that let the accessibility system know your app’s layout or UI have changed.
New notifications provide information about the state of VoiceOver announcements.
The UIActivityViewController class adds support for sharing content via services like email, Twitter, and Facebook; see also, “Social Framework.”
The UIDevice class adds advertising-specific and vendor-specific identifiers.
The UIImage class includes new initialization methods for specifying the scale factor of an image.
Appearance customization support has been added to the UIBarButtonItem, UIPageControl, UIPageViewController, UISwitch, and UIStepper classes.
The UITableView class includes the following changes:
Support for a new UITableViewHeaderFooterView class implements the table’s headers and footers
A simplified model for creating and managing cells and other views.
The UITableViewController class allows you to add a built-in refresh control (UIRefreshControl) to reload the table contents.
Storyboards allow you to unwind segues and specify restoration identifiers.
The UIWebView class provides a way to disable the incremental rendering of web content.
The UIViewController class has new interfaces supporting the following behaviors:
New interfaces provide a clearer path for managing and tracking interface rotations.
You can prevent a segue from being triggered.
Support has been added for unwinding segues.
You can now subclass UINavigationBar and incorporate your custom navigation bar into your app’s navigation interfaces.
For information about the classes of the UIKit framework, see UIKit Framework Reference.
OpenGL ES
OpenGL ES includes the following new extensions:
The GL_EXT_texture_storage extension allows your app to specify the entire structure of a texture in a single call, allowing your textures to be optimized further by OpenGL ES.
The GL_APPLE_copy_texture_levels extension builds on top of the functionality of the GL_EXT_texture_storage extension and allows a set of texture mipmaps to be copied from one texture to another.
The GL_APPLE_map_buffer_range extension improves performance when you only need to modify a subset of a buffer object.
The GL_APPLE_sync extension provides fine-grain synchronization to your app. It allows you to choose a subset of submitted OpenGL ES commands and block until those commands complete.
The GL_APPLE_shader_framebuffer_fetch extension is only available to OpenGL ES 2.0 applications and provides access to the framebuffer data as an input to your fragment shader.
These extensions are available on all devices capable of running iOS 6. As always, check for the existence of an extension before using it in your application.
Media Player Framework
The MPVolumeView class now provides interfaces for customizing the appearance of the volume view. You can use these interfaces to change the images associated with the volume slider and routing button.
For information about the classes of the Media Player framework, see Media Player Framework Reference.
Image IO Framework
The Image IO framework (ImageIO.framework) includes support for accessing EXIF and IPTC metadata properties for images. You can access this metadata using functions associated with the CGImageSourceRef and CGImageDestinationRef opaque types.
For information about the classes of the Image IO framework, see Image I/O Reference Collection.
iAd Framework
The iAd framework (iAd.framework) supports a new medium rectangle banner size for ads on iPad devices. For information about the classes of the iAd framework, see iAd Framework Reference.
Foundation Framework
The Foundation framework (Foundation.framework) includes the following enhancements:
The NSFileManager class includes the ubiquityIdentityToken method for determining the availability of iCloud, and the NSUbiquityIdentityDidChangeNotification notification for responding to a user logging into or out of iCloud, or changing accounts.
The NSUUID class helps you create objects that represent various types of UUIDs (Universally Unique Identifiers). For example, you can create an NSUUID object with RFC 4122 version 4 random bytes, or you can base it on an existing UUID string.
The NSURLRequest class lets you specify whether a request should be allowed to happen over a cellular network.
The NSString class has new methods for converting a string to uppercase, lowercase, or an initial capital case.
For information about the classes of the Foundation framework, see Foundation Framework Reference.
External Accessory Framework
The External Accessory framework (ExternalAccessory.framework) includes new interfaces for managing connections to Bluetooth devices. Apps can now post an alert panel that lists the Bluetooth devices available for pairing. Support is also provided for waking previously paired accessories that do not automatically connect.
For information about the classes of the External Accessory framework, see External Accessory Framework Reference.
Event Kit Framework
The Event Kit framework (EventKit.framework) includes the following enhancements:
The framework supports the creation of reminders; see “Reminders.”
Calendar and reminder events can now vend an external identifier that lets multiple devices refer to the same event on the server. The server provides the actual identifier string, which is accessed using the calendarItemExternalIdentifier property of EKCalendarItem.
For apps linked against iOS 6 and later, the system asks for the user’s permission before granting access to calendar and reminder data.
Apps can now cancel editing programmatically from an EKEventEditViewController object.
For information about the classes of the Event Kit framework, see Calendar and Reminders Programming Guide.
Core Video Framework
The Core Video framework (CoreVideo.framework) adds support for two new pixel formats. These formats provide efficient storage for one-channel and two-channel images that interoperate with OpenGL ES. For information about the functions of the Core Video framework, see Core Video Framework Reference.
Core Media Framework
The Core Media framework (CoreMedia.framework) adds the CMClockRef and CMTimebaseRef types, which define fundamental media time service behaviors. For information about the functions of the Core Media framework, see Core Media Framework Reference.
Core Location Framework
The Core Location framework (CoreLocation.framework) includes the following changes.
The CLLocationManager object now pauses the delivery of location events when the user has not moved for an extended period of time. This behavior saves power by allowing the framework to turn off the GPS and other hardware. It is enabled by default but may be disabled by changing the value in the pausesLocationUpdatesAutomatically property of the location manager object.
You can refine location accuracy based on usage by assigning an appropriate value to the activityType property of CLLocationManager. This property currently lets you distinguish between driving usage and fitness usage.
The framework supports improved location accuracy while offline and driving.
For information about the classes of the Core Location framework, see Core Location Framework Reference.
Core Bluetooth Framework
The Core Bluetooth framework (CoreBluetooth.framework) supports interacting with Bluetooth devices in peripheral mode. Previously, an iOS device could only interact in central mode but it can advertise itself in peripheral mode and communicate with other iOS devices.
For information about the classes of the Core Bluetooth framework, see Core Bluetooth Framework Reference.
Core Audio
Core Audio family of frameworks includes the following changes:
There is a new AUDeferredRenderer audio unit that allows audio to be processed on a lower-priority thread using relatively larger time slices.
The AudioQueueProcessingTap audio unit allows you to intercept the data in an audio queue and process it.
For information about the audio technologies available in iOS, see Multimedia Programming Guide. For information about the new audio units, see Audio Unit Component Services Reference.
AV Foundation Framework
The AV Foundation framework (AVFoundation.framework) includes the following enhancements:
The AVPlayer class adds support for syncing playback to an external time source. A single player object can also play both HTTP Live Streams and file-based assets (including both local files and files that are progressively downloaded). And you can use multiple AVPlayerLayer objects to display the visual output of the same player object.
The new AVPlayerItemOutput class works with an AVPlayerItem object to obtain decoded video frames during playback so that your app can process them.
The AVAssetResourceLoader class allows you to insert a delegate object into the asset loading process and handle custom resource requests. This class works with the AVURLAsset class.
The AVAudioSession class now exposes information about the current audio route in use.
The AVAudioMixInputParameters class provides access to an MTAudioProcessingTapRef data type, which can be used to access audio data before it is played, read, or exported.
The AVAudioSession class includes the following enhancements:
Use of an audio session delegate to detect interruptions and changes is now deprecated in favor of a set of new notifications.
Audio sessions support a new audio category, AVAudioSessionCategoryMultiRoute, that allows routing of audio to and from multiple audio hardware devices.
Audio sessions support a new mode, AVAudioSessionModeMoviePlayback, that engages appropriate output signal processing for movie playback scenarios.
The AVCaptureConnection class allows you to enable or disable support for video stabilization on incoming video.
The AVCaptureMetadataOutput class is a new class for intercepting metadata emitted by a capture connection object.
The AVMetadataFaceObject is a new class that reports the face-detection data captured by an AVCaptureMetadataOutput object.
The AVTextStyleRule class is a new class for specifying style options for subtitles, closed captions, and other text-related media assets.
The AVAudioPlayer class can play audio items from the user’s iPod library using URLs obtained from the MPMediaLibrary class. You can also set channel assignments using the channelAssignments property.
For information about the classes of the AV Foundation framework, see AV Foundation Framework Reference.
Accelerate Framework
The Accelerate framework (Accelerate.framework) includes new vector-scalar power functions, vDSP functions, discrete cosine transform functions, SSE-related vector functions, sine functions, and vImage functions.
For information about the functions of the Accelerate framework, see Accelerate Framework Reference.


Thank you for reading and support!


Good luck!


M.P.PRABAKAR
Technical team lead.
Mobile app development.