Saturday, April 28, 2012

Java : Apple Push Notification Server Side Coding

JavaPNS is a Java library to send notifications through the Apple Push Notification Service to iOS devices. Using JavaPNS, we can send Push notification in a single line of code.

For further details, refer site : http://code.google.com/p/javapns/
The Apple Push Notification Service is a service created by Apple Inc. 
iOS apps can provide three types of notifications:
  • Sounds: Plays an audible alert
  • Alerts/Banners: Displays an alert or banner on the screen
  • Badges: Displays an image or number on the application icon
 Before sending a notification from server, we need to have the following.
  1. Device Token of the device (IPhone/IPod).
  2. Private Key created from certificate.
  3. Have a password of the private key created.
Note: If the private key is not proper, SSLHandshakeException occurs

For Eg:
Java Code looks like
Push.alert(message, keystore, password, production, devices)



Push.alert("Hello World!", "keystore.p12", "keystore_password", false, "Your token");
Parameters:
message : Content to pass
keystore : Private key
password : Private key password
producation : If true, production else sandbox
devices : one or more device token, device token length is 64 digits. The device token is analogous to a phone number; it contains information that enables APNs to locate the device on which the client application is installed.

To run the server code, required jar files list
bcprov-1.45.jar
commons-io-1.3.jar
commons-logging-1.1.1.jar
JavaPNS_2.2.jar
log4j-1.2.16.jar


Thanks for reading :).
Whether this post is helpful?
Please leave a comment.

Sunday, April 1, 2012

Android : Unsupported devices due to your manifest settings

If you have seen the error message
"Unsupported devices due to your manifest settings"

It may be one of the scenario, be aware of the permission provided in the manifest file.
Everyone knows there is “android.permission.SEND_SMS” permissions in manifest file which supports android.hardware.telephony feature.

uses-feature is used to filter the app in market or Google play. 
When we support large and Ex-large devices in android, we should be aware of few points.
As, we know most of large and Ex-large devices of android won’t support “android.hardware.telephony”. So, when you publish the app into market, we won’t able to see the app from Google play when you search in those devices, since telephony feature is not supported.

So, we need to add the below line, it means that the application prefers to use the feature if present on the device.
<uses-feature android:name="android.hardware.telephony" android:required="false" />

Android : Remember before Publishing app to Google Play or Market

Remember few things before publishing app into Google Play or Market.

1.    Create an APK file which validates minimum for 50 years.
2.    Have one High Resolution Application Icon, with 512 x 512, 32 bit PNG or JPEG and Maximum: 1024 KB size
3.    Have description of your application ready.

Note:
If you have provided permission in manifest file, check whether all the devices which you support have the hardware compatibility or not.