Posts

Showing posts with the label android programming

"Server could not process your apk" problem

Image
After completing the development and the signing process of the application on which I'm working , I was trying to upload it in the Google Play. But I was getting this error The server could not process your apk. Try again After Googling for sometime, I came to know that this error arises when there is a problem in the manifest file included in the apk. From Android developer forums, I came to know that this problem is not happening only to me. Many developers are facing this problem. In my case, the reason behind the problem was very peculiar. In my manifest file, one of my activities was declared like this                  <activity             android:name=".views.user.ChangeEmailFormActivity"             android:label="Change Email Address"             android:theme="@android:style/Theme.Dialog"         ...

Simple animation in android

Hi, here is a way to create a very simple animation in android. Probably you know that there are tow types of animations in android. 1. tween animation and 2. Frame animation I'm describing a simple example of tween animation. Let's start. suppose we have a ImageView on a LinearLayout. we want to create a animation so that the image will move from a point to another point. First we have to create a xml file in the res/layout folder in which we'll show the image. It may be something like this - <?xml version="1.0" encoding="utf-8"? > < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:layout_gravity="center" android:layout_height="fill_parent" android:layout_width="fill_parent" > < ImageView android:background="@drawable/animtest" android:layout_w...

to get email address from the addressbook in android

courtesy to http://www.anddev.org/viewtopic.php?p=19672 first add uses_permissions for reading contacts in the manifest file. then add this code inside any function(i.e onCreate() of activity) Uri mContacts = Contacts.ContactMethods.CONTENT_URI; String[] projection = new String[] { Contacts.ContactMethods.PERSON_ID, Contacts.ContactMethods.DISPLAY_NAME, Contacts.ContactMethods.KIND, Contacts.ContactMethods.DATA }; Cursor c = this.managedQuery(mContacts, projection, null, null, Contacts.ContactMethods.DISPLAY_NAME + " ASC"); c.moveToFirst(); int previousId = -1; do { int personId = c.getInt(c .getColumnIndex(Contacts.ContactMethods.PERSON_ID)); if (personId != previousId) { String personName = c.getString(c .getColumnIndex(Contacts.ContactMethods.DISPLAY_NAME)); Log.i("name",personName); } int dataKind = c.getInt(c .getColumnIndex(Contacts.ContactMethods.KIND)); if (dataKind == 1) { String personE...