Monday 6 August 2012

Learning about most effective View in Android 'ListView'


Hello every one, in this post i would like to share about the most powerful view in our android that is ListView (i felt  this view is the most effective one in Android). ListView class which is capable of displaying a scrollable list of items. The items can be of any type.

We have lots of ways to set values into a ListView. Some ways that i learned are 
  1. Setting ListView with layout(view) provided by Android resources.
  2. Setting ListView with our own layout.
  3. Setting ListView with different images as item.

Now i am gonna explain each way one by one..

Setting ListView with layout provided by Android resources

Add Listview to main.xml

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>

</LinearLayout>

Then create an array named 'values' in the corresponding acitvity and put some items in it. Create Listview object and initialize it with corresponding id. Then comes the magic thing ‘ArrayAdapter’
As we know Listview is a group of items, each item will contain a TextView. Now the job of  ArrayAdapter is to take each values from the array ‘values’ and sets the TextView with that value, then this TextView is set as an item for ListView. So the ArrayAdapter works or loops as the length of the array we used. On the initialization of ArrayAdapter what we want to do is, indicate which array we are using and  which TextView (or view) we want to use as item of ListView.

ListExample Activity for main.xml

public class ListExample extends Activity {
       ListView lv;
       String[] values;
       ArrayAdapter<String>myAdapter;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        init();
        lv.setAdapter(myAdapter);
    }
       public void init() {
              // TODO Auto-generated method stub
              lv=(ListView)findViewById(R.id.listView1);
              values=new String[]{"folder1","image1.png","text.txt","image2.png","folder2","text2.txt"};
              myAdapter=new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, values);
       }
}

Here we have used android.R.layout.simple_list_item_1. The simple_list_item_1 will contain a TextView. To see the content in simple_list_item_1 navigate to android-sdk-windows/platforms/android-(api level)/data/res/layout. Here we see a lots of xml file which provided by Android resources

simple_list_item_1.xml

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
    android:paddingLeft="6dip"
    android:minHeight="?android:attr/listPreferredItemHeight"
/>

The output for the above code will be like this
That's all for this post. The next post will explain 'Setting Listview with our own layout'.

Thursday 2 August 2012

How to Promote your Android Application?

I had made more than 10 apps in Android, yet i have't uploaded anything to Google Play. My dream is the first app i upload should make a lots of hit. For this i searched and found a good feature about "Promotion Of Mobile Application", sharing it with you.


If you have successfully developed and launched your dream Mobile Application. What next?
How will people come to know about the mobile application you have developed with lot of efforts?
How will you make them aware that something useful that your company has developed is waiting for them?
There are billions of Mobile Apps floating in the app world. How are you going to make the actual users download yours?
The answer to all the above questions is Promotion and Marketing of your Mobile Application. But this is not every one’s cup of tea. It can be a backbreaking task for a Mobile Application Development Company or a novice who is not aware how to start and from where to start its marketing.
So, here goes the list on tips to promote your Mobile Application:

1. Create pre launch buzz – Create a buzz for your app before it gets launched. Post in social networking websites to create curiosity amongst the public. Tell users that how the App is useful for them and that why they should download them. You can create an attractive page stating “coming soon on the shop floor” and buzz it on LinkedIn, Facebook and Twitter.

2. “Free” word is always attractive – Believe me this word does miracles. To begin with, a mobile application development company can launch the lite version of Mobile app, so that users can download it for free and try it. And once you gain popularity launch the further versions as paid ones. If it’s a gaming app, then give them a chance to play free.

3. App Store, your good friend – Not to mention, the app store is the best place to showcase your mobile application. People often search in the app stores and on Google for the latest available applications. Try to make your mobile app unique by assigning it a unique name. If possible use your targeted keyword in the App name so that when people search, yours app appear first. This will surely affect your number of downloads.

4. Get your Mobile App reviewed – Mobile application review sites, according to marketing experts, are outstanding platforms to promote mobile apps. There are good numbers of app reviews sites available in Mobile world wherein you can submit your mobile app and get reviews for it. This not only updates the users about your app but also help them deciding whether or not to download it.

The next two points sometimes wont be helpful for you..

5. Spread it through Press Release – Market your mobile application using Press Release. These media Releases do wonders if you use them suitably. Slot in targeted keywords associated with your mobile app in the press release, so that the users as well as the crawlers find it easy to locate your app in the Mobile app world. Press releases give your app an immediate visibility by reaching targeted users and increasing its awareness amongst the users.

6. Email marketing, old but gold – As most of the people access their emails using mobile devices; you can easily promote your mobile app via e-mail marketing. Here your focus should be on providing useful and informative content to your customers. Gather a list of users from database available on various sites and shoot an email showcasing your mobile app screenshots, features and technical specifications.

So, how do you like the post. Of course there is lot more to jot down and I am in the process of writing them down. But it might take some time because i wanna put the best in front of you. In the meantime you can apply the above ones and i am sure they will prove helpful.