I wrote a code in android about bluetooth programming.I want that when I opened the tablet The app start firstly.The tablet must be specific to an application.
How is it possible ?
I wrote a code in android about bluetooth programming.I want that when I opened the tablet The app start firstly.The tablet must be specific to an application.
How is it possible ?
If you want to start your app as soon as the user starts the tablet, then user atleast should've opened the application once after installation. Then you can use android.intent.action.BOOT_COMPLETED
action and register a BroadcastReceiver
to start the application automatically everytime the user reboots the deive. See Auto start application after boot completed in Android and Broadcast receiver not working in ICS if the app is not started atleast once. Hope this helps.
Creating a home screen/launcher app is the way to go.
<activity android:name="Home"
...
android:launchMode="singleInstance"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
category android:name="android.intent.category.HOME" - makes your application a home screen(launcher) app. You can view the home screen sample from android-sdk samples/Home
You can add in Manifest file
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
to the main Activity declaration. Then you should set your app to always run as default