0

I want to create a app without any UI and It should be work as a service application.I have used boot completed event in the app, When I run the app in 2.3(Gingerbread) version then its working propely but its not working on Jellybean version.But if I run the app with any activity then it works propely in both versions.Please give me a solution.

AndroidManifest file.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bootreceivecheck"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <receiver android:name="com.home.BootReceiver.BootCompleteReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />             
            </intent-filter>
        </receiver>

    </application>

</manifest>

class file.

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;


public class BootCompleteReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent arg1) {
        try
        {
            Toast.makeText(context, "Mobile Boot Completed", Toast.LENGTH_LONG).show();
        }catch(Exception ex)
        {
            Toast.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show();
        }

    }

}
Milinda Saranga
  • 205
  • 3
  • 13
  • 1
    After honeycomb, it is not allowed kind of hidden application, at least you should provide some kind of control UI activity to user. Please check this similar question - [link](http://stackoverflow.com/questions/11096673/launch-application-without-an-interface-to-receive-boot-completed/11099685#11099685) and related [post](http://commonsware.com/blog/2011/07/13/boot-completed-regression-confirmed.html) – Chansuk Aug 22 '13 at 01:17
  • Thanks sir,can't we hide apps in another way? – Milinda Saranga Aug 23 '13 at 01:27

0 Answers0