Android developer tips & tricks

Posted on 13 Ocak 2012 in İnternet, Programlama by

Hey dudes, i just wanted to gather some ui design & coding tips and tricks together. I dont make money from mobile application development yet so i can not spare enough time to read whole android development documentation. Lets start:

Tile Background
1- http://savagelook.com/blog/android/2976
2- http://www.stripegenerator.com (Make your own stripe)
3- http://designshack.net/articles/freebies/weekly-freebies-30-seriously-useful-seamless-textures

4- http://www.premiumpixels.com/

** To cope with the black screen issue while scrolling list view add the following option to layout
android:cacheColorHint=”#00000000″// setting as a transparent color

Popup windows
1- http://www.androiddom.com/2011/06/displaying-android-pop-up-dialog_13.html
* This one below actually generates blured popup window that encapsulates whole screen
2- http://www.androidcompetencycenter.com/2009/10/styles-and-themes

Swiping Views
1- http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

Quick Actions
1- http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

Using media player with services
1- http://www.java2s.com/Code/Android/Media/UsingServicetoplaymediafile.htm
* Simple code
Http Authentication
1- http://stackoverflow.com/questions/1968416/how-to-do-http-authentication-in-android

Z index ordering
1- http://developer.android.com/resources/articles/layout-tricks-merge.html
2- http://stackoverflow.com/questions/3929412/android-layout-layers-z-axis

1
2
3
4
5
6
7
8
9
10
<FrameLayout>
  <RelativeLayout>
    <!--  Place the objects you want on the bottom here -->
  </RelativeLayout>
 
 
  <RelativeLayout>
    <!--  Place the objects you want on the top here -->
  </RelativeLayout>
</FrameLayout>

Adding empty views to end of listview
* inspired from this solution
– Create a layout and add a button which has invisible button
– Add this view to end of list view by calling following codes

1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/bottom_control_bar"
	android:layout_width="fill_parent" android:layout_height="wrap_content"
	android:layout_alignParentBottom="true">
	<Button 
	    android:layout_width="fill_parent"
		android:layout_height="wrap_content" 
		android:text="Add Item" 
		android:visibility="invisible"/>
</LinearLayout>

And call it as following

1
2
3
4
View v = getLayoutInflater().inflate(R.layout.deneme, null);
getListView().addFooterView(v);
getListView().addFooterView(v);
setListAdapter(this.m_adapter);

Creating custom dialog box
1- http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application

Prevent calling onCreate on orientation change
android:configChanges=”orientation|keyboardHidden”
1- http://developer.android.com/guide/topics/resources/runtime-changes.html

Custom android edit text – changing edit text widget
1- http://www.androidworks.com/changing-the-android-edittext-ui-widget

iPhone like tabs without borderline and custom looking
1- http://bakhtiyor.com/2009/10/iphonish-tabs/

Please give us your valuable comment

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image

This site uses Akismet to reduce spam. Learn how your comment data is processed.