Tag Archives: Parse

How to write a custom content provider in android? with a sample application using our own custom content provider.

By | September 22, 2013

Hello all we all know what are content providers right? Those who are unaware of content providers please visit this link http://developer.android.com/guide/topics/providers/content-providers.html In a breif content Providers are Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security. Content providers are the standard interface that connects data… Read More »

How to Convert a string to date in JAVA ?

By | April 3, 2012

Hi, For converting string to a date in JAVA use the following code. [java] import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String[] args) throws Exception { SimpleDateFormat myDateFormat = new SimpleDateFormat("dd/MM/yyyy"); Date dateToday = dateFormat.parse("25/06/2011"); System.out.println(myDateFormat.format(dateToday)); } } [/java] 🙂

How to start an application at bootup in ANDROID?

By | October 4, 2010

This snippet starts an Application automatically after the android-os booted up. [java] String url = "url"; Intent intent1 = new Intent(Intent.ACTION_VIEW); intent1.setData(Uri.parse(url)); startActivity(intent1); [/java] in AndroidManifest.xml (application-part): [xml] <receiver android:enabled="true" android:name=".BootUpReceiver" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver> [..] <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> [..] [/xml] [java] public class BootUpReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context,… Read More »