Skip to main content

Posts

How to use fix crashes for marshmallow for android app development.
Recent posts

Audio Streaming In Android

public class ListenAudio extends Activity {         /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState)     {         super.onCreate(savedInstanceState);         Intent in = getIntent();         String path = in.getStringExtra("Path");                MediaPlayer mediaPlayer = new MediaPlayer();         mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);         try {             mediaPlayer.setDataSource(path);         } catch (IllegalArgumentException e) {             // TODO Auto-generated catch block  ...

How to change textcolor of tab text in Android

How to change textcolor of tab text in Android TabHost tabs = (TabHost)findViewById(R.id.TabHost01);         tabs.setup(getLocalActivityManager());                       TabHost.TabSpec search = tabs.newTabSpec("tag1");         search.setContent(new Intent(this,Searchgurbani.class));         search.setIndicator("Find Me");         tabs.addTab(search);                TabHost.TabSpec pref = tabs.newTabSpec("tag5");         pref.setContent(new Intent(this,Preferencegurbani.class));         pref.setIndicator("Settings");         tabs.addTab(pref);                TabHost.TabSpec favorite =...

how to get shai finger print for google map api v2

Step 1 open command promp step 2 navigate to folder where java is installed step  3 then navigate  go to jdk folder bin form there type the below command The path in inverted comma below is the path of android debug key stroke which can be found in C drive under particular user folder just replace the path step 4 type the command keytool.exe -v -list  -keystore "C:\Users\NewPC\.android\debug.keystore" -storepass android -keypass android output will be like this Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: androiddebugkey Creation date: 7 Feb, 2013 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=Android Debug, O=Android, C=US Issuer: CN=Android Debug, O=Android, C=US Serial number: 511358c0 Valid from: Thu Feb 07 13:03:20 IST 2013 until: Sat Jan 31 13:03:20 IST 2043 Certificate fingerprints:          MD5:  0E:CE:35:CE:CB:66:CC:80:95:68:...

Class cast exception

This Exception mainly occur because when we create an action on click of a button or an action to be performed on start of an activity ,but we forget the write the code in the activity for which we wrote intent to go. for example in  a main.xml file we have 7 buttons. <ScrollView  xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"         android:layout_height="fill_parent"         >     <LinearLayout         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:orientation="vertical"         android:padding="30dp" >         <TextView             android:id="@+id/textView1"             android:layout_width="wrap_content"       ...

Android ListView with Searchbox Sort items

This article is next step of List Example. Here we have a search box which sorts the list view as when the content matches the list items. Why do we need this? Imagine that if we have 2K to 3K items in the listview, It will not be possible to  scrolldown till 2000 th  item.In this case this will be handy to cut short items. To start with we add a edittext box and Listview added to LinearLayout. [sourcecode language="xml"] <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"> <EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:hint="Search"></EditText><ListView androi...

Android Listview Example

Today, we are going to see about a simple listview example. In Android, Listview is used to show a list of items in a vertically scrolling list.  Learn a listview of android array in this tutorial. For instance, in a Registration form when we are selecting professions a list of items will be displayed. We can use Listview to display the list of items. Your XML file should look like [sourcecode language="xml"] <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <ListView android:id="@+id/ListView01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> [/sourcecode] Your Java code looks like [sourcecode language="java"] public class List...