开发者

Need Help in services running in background

I need to create 开发者_JS百科a background service like when user is trying to open any of the installed application, let him know that application's information (eg: Package-name) before that application begins to starts.


As far as I know, this isn't possible unless a) the app is a launcher, which can show a notification before starting applications, or b) the app requires root access -- something I'm assuming you don't want.

For Android, it would be a serious issue if a service could stop the user from opening apps: the service could start on boot, and then no other apps could be opened to shut it down, rendering the device useless.

Hope this helps.


you can create services by this way ::

package com.Touch;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;

public class BackServices extends Service {


    @Override
    public IBinder onBind(Intent arg0) {

        return null;
    }

    @Override
    public void onCreate() {

    }

    @Override
    public void onDestroy() {

    }

    @Override
    public void onStart(Intent intent, int startid) {

    }

}

and you can get install ap information by this :: http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜