-
-
Enable Mcrypt on PHP Install in Appserv
April 24, 2013 By SantoshPlease follow the below steps: Add libmcrypt.dll to the System32 folder Uncommnte the include_path var in php.ini Restart Apache Read More » -
Dynamic Menu in Android
April 22, 2013 By Santoshimport android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.Toast; public class MenuDemo extends Activity { Read More » -
PhoneStateListener Example
April 22, 2013 By SantoshWe have to include this permission in Manifest: <uses-permission android:name=”android.permission.READ_PHONE_STATE”/> Add the below program to your main activity class: TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); tm.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); Read More » -
How to Create a Playlist
February 16, 2013 By Santoshpublic void checkforplaylists(Context context) { ContentResolver cr = context.getContentResolver(); final Uri uri=MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI; final String id=MediaStore.Audio.Playlists._ID; final String name=MediaStore.Audio.Playlists.NAME; final String[]columns={id,name}; final Cursor playlists= cr.query(uri, columns, null, Read More » -
Search all audio files from android using MediaStore
January 26, 2013 By SantoshString[] proj = { MediaStore.Audio.Media._ID, MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.DISPLAY_NAME, MediaStore.Video.Media.SIZE }; Cursor musiccursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,proj, null, null, null); while(musiccursor.moveToNext()) { HashMap<String, String> song = new HashMap<String, String>(); song.put(“songTitle”,musiccursor.getString(2)); Read More »
-
Enable Mcrypt on PHP Install in Appserv
Please follow the below steps: Add libmcrypt.dll to the System32 folder Uncommnte the include_path var in php.ini Restart Apache
Dynamic Menu in Android
import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.Toast; public class MenuDemo extends Activity { /** Called when the activity is first created. */ private Context context; Button btnMenu; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = this; LinearLayout llay = new LinearLayout(context); btnMenu = new Button(context); btnMenu.setText(“Show Menu”); llay.addView(btnMenu); setContentView(llay); registerForContextMenu(btnMenu); } @Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenu.ContextMenuInfo menuInfo) {//Context Menu that appears when long clicked. Menu m_menu
PhoneStateListener Example
We have to include this permission in Manifest: <uses-permission android:name=”android.permission.READ_PHONE_STATE”/> Add the below program to your main activity class: TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); tm.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); // somewhere else private PhoneStateListener mPhoneListener = new PhoneStateListener() { public void onCallStateChanged(int state, String incomingNumber) { try { switch (state) { case TelephonyManager.CALL_STATE_RINGING: // do something… break; case TelephonyManager.CALL_STATE_OFFHOOK:
How to Create a Playlist
public void checkforplaylists(Context context) { ContentResolver cr = context.getContentResolver(); final Uri uri=MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI; final String id=MediaStore.Audio.Playlists._ID; final String name=MediaStore.Audio.Playlists.NAME; final String[]columns={id,name}; final Cursor playlists= cr.query(uri, columns, null, null, null); if(playlists==null) { Log.e(TAG,”Found no playlists.”); return; } Log.e(TAG,”Found playlists.”); return; }



