Posts

Showing posts from 2013

Open Android market (Google Play Store) using Intent

To open google play store (Android market) using intent, just use the code snippet String appName = ""; Uri uri = Uri.parse("market://details?id=" + appName); Intent intent = new Intent(Intent.ACTION_VIEW, uri); if (isAvaialable(intent, mContext)) { startActivity(intent); } else { Uri uri = Uri.parse("http://play.google.com/store/apps/details?id="+appName); intent.setData(uri); startActivity(intent); } public static boolean isAvailable(Context ctx, Intent intent) { final PackageManager mgr = ctx.getPackageManager(); List list = mgr.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return list.size() > 0; } isAvailable() is an utility method that I got from http://www.grokkingandroid.com/checking-intent-availability/

Uniquely Identify a device in Android

For many of the application we may require to uniquely Identify android device. The best way to get the unique device Id is through Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID); according to the "android developers blog".

After updating to ADT 22, no more R.java files

Image
I recently came across this problem that after updating the ADT to 22, none of my apps are building. Android can't create the R.java file. The solution for this is, open "Android SDK Manager". Download "Android SDK build tools". Then for safety, restart your eclipse. That's it. Back to normal. All apps start building.

Dropbox client for Android

Image
In one of my projects, I need to create a client in Android for Dropbox. So I like to share my experience in creating the Dropbox client. Dropbox has an Android SDK. So developers can just call the API and can use. When connecting the app with any cloud say, the authentication part is the tricky and some what complicated one. Once app establishes a connection to the cloud, then getting resources (say, files) is just a cakewalk. First I will just list down the steps for creating the dropbox client in Android.

1. First create an account in "Dropbox"

2. Then in developers page, go to the tab "My Apps". Click on the "Create an App". A dialog appears, there we specify our App name as well as the access level, either "full access" or "app folder" (means only to a specific folder in your account). We can select any one according to our choice.



3. After creating the app in dropbox, we will get the "App Key" & "App Secret&q…