GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - leon087/MyLibrary

BranchesTags
Open more actions menu

Latest commit

 

History

255 Commits
255 Commits

Folders and files

NameName
Last commit message
Last commit date
app/MySample
app/MySample
 
 
config/unittest
config/unittest
 
 
gradle/wrapper
gradle/wrapper
 
 
lib
lib
 
 
local_repo/ggg/android/gradle-plugin
local_repo/ggg/android/gradle-plugin
 
 
.cvsignore
.cvsignore
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
ext-android.gradle
ext-android.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
local.properties
local.properties
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

简介

  • MyFramework:基础框架,支持后台保活、多进程绑定、支持跨进程共享Binder
  • MyUtil:util集合
  • MyCommon:功能模块,包含了数据库、缓存、静默与非静默安装卸载等

MyFramework

初始化与关闭:

public class MainApp extends Application {
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);

        Framework.get().config(new Config.Builder()
                .authorities(base.getPackageName() + "." + ServerProvider.AUTHORITIES)
                .serverProcess(base.getApplicationInfo().processName + ":framework")
                .build());
        Framework.get().startup(base, MyBinderServer.class);
    }
}
/**
*  运行在framework进程
*/
public class MyBinderServer extends BaseBinderServer {
    private static final Logger logger = LoggerFactory.getLogger("MyBinderServer");

    private TestManagerServer testManager;
    private Context context;

    private TimerServer timerServer;

    @Override
    protected void create(Context context) {
        this.context = context;
        timerServer = new TimerServer();
        timerServer.start(context);

        Framework.addService(TestContext.TIMER_TASK_SERVER, timerServer);
    }

    @Override
    protected void destroy() {
        ThreadUtil.newCachedThreadPool().execute(new Runnable() {
            @Override
            public void run() {
                Bundle bundle = Framework.get().getBundle("ggg");
                while (bundle != null && !bundle.getBoolean("exit")) {
                    logger.error("hhh bundle.getBoolean(\"exit\") = " + bundle.getBoolean("exit"));
                    ThreadUtil.sleep(20);
                    bundle = Framework.get().getBundle("ggg");
                }

                logger.error("hhh destroy");
                Framework.clearService();
                timerServer.stop();
                MyBinderServer.this.context = null;
            }
        });
    }

    @Override
    protected void startService() {
        MainService.start(context);
    }

    @Override
    protected void stopService() {
        MainService.stop(context);
    }
}
public class App {
    public void init() {
        //初始化app
        Framework.get().start();
    }

    public void deInit() {
        //退出app
        Framework.get().stop();
    }

    public static TimerManager getTimerManager() {
        TimerManager test = Framework.getBinderProxy(TestContext.TIMER_TASK_SERVER, TimerManager.class);
        return test;
    }
}

License

Apache 2.0

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

4 stars

Watchers

0 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.