Android Plugin Framework

Overview

Android Plugin Framework

This project is pre-mature and may be changed very frequently.

Introduction

Android Plugin Framework (APF) aims to providing a flexible, extensible framework, for Android applications, like OSGi for Java applications. App developers can design their Android applications in a totally new way: declar the interface of a application component, put the actual implementations of the component on the remote server, use APF library to load the actual implementations at runtime. In this way, app developers can dynamically update application components, or add features to an already installed application, without requiring the application being updated throught Android System Framework. A typical usage scenario can be skin: designers design various skins for an application according to pre-defined format and then put those skin files online. App users can then find and use skins through skin store, without having to installing a new version of the app.
Another using scenario is for game design: design the hard level of a game in a different package that can be dynamically load into the game. When an user passes the low level of the game, the app can load the hard level of game code using APF dynamically. The user gets a seemlessly upgrade experience.

The project consists 3 major components:

APF core

The core library to find, verify and load plugin code from remote servers. Now, the architecture and the remote server is still pre-mature and is subject to change, so it is not open sourced yet. But it will be soon.

Plugin Build Scripts

The instructions to create your own plugins. Check [Creating Your APF Plugin] for details.

Example

Example contains:

  1. Host application, Android Application Project.
  2. Plugin Interface, as an Android Library Project
  3. Plugin Implementation, as an Android Application Project

There is already an example plugin implementation signed by Umeng and hosted on Umeng's server side. If you want to try it out and have a different implementation, please contact xuxianming @ umeng.com

Creating Your APF Plugin

To create a effective APD plugin, you will need to design plugin interface first in an Android Library Project. Next, implement the declared interface in an Android Application Project.

Plugin Interface

  • Create an Android Library Project.
android create lib-project -n com_example_plugin1_ifs -t android-17 -k com.example.plugin1.ifs -p com.example.plugin1.ifs
  • Update ant.properties according to the template file apf-plugin-build/ant.properties.example
/apf-opensource/com.example.plugin1$ cat ../apf-plugin-build/ant.properties.example >> ant.properties 

The ant.properties looks like:

# This file is used to override default values used by the Ant build system.
#
# This file must be checked into Version Control Systems, as it is
# integral to the build system of your project.

# This file is only used by the Ant script.

# You can use this to override default values such as
#  'source.dir' for the location of your java source folder and
#  'out.dir' for the location of your output folder.

# You can also use it define how the release builds are signed by declaring
# the following properties:
#  'key.store' for the location of your keystore and
#  'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
key.store=../apf-plugin-build/debug.keystore
key.store.password=android
key.alias=androiddebugkey
key.alias.password=android
  • Update build.xml according to the template file build.xml.plugin.ifs.example
apf-opensource/com.example.plugin1.ifs$ cp ../apf-plugin-build/build.xml.plugin.ifs.example build.xml 
  • Design the interface to be used by the host application. Check: src/com/example/plugin1/ifs/

Plugin Implementation

  • Create an Android Application Project.
android create project -n com_example_plugin1 -t android-17 -k com.example.plugin1 -p com.example.plugin1 -a PluginActivity
cd com.example.plugin1
android update project -p ./ --library ../com.example.plugin1.ifs
  • Update ant.properties according to the template file ant.properties.example

  • Update build.xml according to the template file build.xml.plugin.ifs.example

apf-opensource/com.example.plugin1$ cp ../apf-plugin-build/build.xml.plugin.example build.xml 
  • Design the interface to be used by the host application. src/com/example/plugin1/ifs/

Plugin Implementation project will be will packaged/exported as ${package-name}.apk and Plugin Interface project will be packaged to ${package-name}.ifs.jar.

For example, com.umeng.analytics.apk for plugin, and com.umeng.analytics.ifs.jar for interfaces declarations.

Build

> ant deploy

The output will be at ${project.dir}/bin/com.example.plugina.apk and ${project.dir}/bin/com.example.plugina.ifs.jar.

Note: if the plugin implementation projec ifself is a android library project, for example, like com.umeng.common, you need a little "hack" to the ant build system. First change ant.properties, change android.library=true to android.library=false. After successfully ant deploy, change it back to android.library=true, as is required by the upper stream application project.

Example

See [com.example.host] and [com.example.plugin1].

To Run the example:

ant 

Signing plugin

All plugins must be signed with private key. APF adopts similar mechanisms as Android app signing. See Signing Your Applications for help.

Sign the plugin apk

  1. Make sure that you can build your plugin interface and implementation with ant successfully before preceeding.
  2. Configure ant.properties. Add the content of ant.properties.example to your plugin implementation project's ant.properties.
  3. Use ant deploy to build the release apk package. This will build a release mode plugin apk called [project-name]-release.apk under bin/ directory.

Warning

When to release your plugin, remember to update the key and keystore. Do not use the example key store used here. Caution: Since APF is in very pre-mature state, it's architecture and server side design is subject to change very frequently. For now, APF provided by Umeng does not allow any plugin signed by third party. If you want to try this out and want to deploy your plugin on Umeng's platform, please develop your plugin first and contact us. After we check out that your plugin is secure, we can sign the plugin for you and host your plugin on Umeng's server. Please email to xuxianming at umeng.com. We will open source implementation of APF when it's architecture design is freezed.

You might also like...
UltimateAndroid is a rapid development framework for developing your apps
UltimateAndroid is a rapid development framework for developing your apps

UltimateAndroid Version:0.10.2 UltimateAndroid is a rapid development framework for developing apps Master branch: Dev branch: V0.7.0 Ui Demo screensh

A framework for hook java methods.
A framework for hook java methods.

Legend Projects are out of date, plese move to: Whale Hook What is Legend? Legend is a Hook framework for Android Development, it allows you to Hook J

A modern framework for full stack web apps in Kotlin
A modern framework for full stack web apps in Kotlin

Kobweb is an opinionated Kotlin framework for creating websites and web apps, built on top of Web Compose and inspired by Next.js and Chakra UI.

Android part of the  Android Studio(IntellijIDEA) OkHttp Profiler plugin
Android part of the Android Studio(IntellijIDEA) OkHttp Profiler plugin

OkHttpProfiler Android Library Created by LocaleBro.com - Android Localization Platform The OkHttp Profiler plugin can show requests from the OkHttp l

A plugin system that runs like a browser, but instead of load web pages, it load apk plugins which runs natively on Android system.
A plugin system that runs like a browser, but instead of load web pages, it load apk plugins which runs natively on Android system.

Android Dynamic Loader Android Dynamic Loader is a plugin system. The host application is like a browser, but instead of load web pages, it load plugi

🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )
🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )

JsonToKotlinClass Hi, Welcome! This is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to

Gradle plugin to deploy Android Snapshot Versions
Gradle plugin to deploy Android Snapshot Versions

Android Snapshot Publisher is a Gradle plugin to prepare and distribute Android Snapshot versions to multiple distribution sources in a simple and com

Intellij Idea, Android Studio plugin for generating Kotlin data classes from JSON. Helps to avoid writing boilerplate code for model classes. Supports annotations for Gson, Moshi, Jackson.
Intellij Idea, Android Studio plugin for generating Kotlin data classes from JSON. Helps to avoid writing boilerplate code for model classes. Supports annotations for Gson, Moshi, Jackson.

JSONToKotlinClass Intellij Idea, Android Studio plugin. Plugin generates Kotlin data classes from JSON text. It can find inner classes in nested JSON.

Small Warp Plugin developed in Kotlin

Warps A small warps plugin for the 1.17 SMP. Minecraft 1.17 Spigot Contributing Install Java 16 Fork this repo Clone your fork Make your changes Use h

Owner
Umeng Limited
Umeng Limited
LiteOrm is a fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line of code efficiently.

#LiteOrm:Android高性能数据库框架 A fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line

马天宇 1.5k Nov 19, 2022
Rosie is an Android framework to create applications following the principles of Clean Architecture.

Rosie The only way to make the deadline—the only way to go fast—is to keep the code as clean as possible at all times. — Robert C. Martin in Clean Cod

Karumi 1.8k Dec 28, 2022
A data-binding Presentation Model(MVVM) framework for the Android platform.

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED. As personal time contraints, I am currently unable to keep up. Please use official android da

RoboBinding open source 1.3k Dec 9, 2022
A full-featured framework that allows building android applications following the principles of Clean Architecture.

EasyMVP A powerful, and very simple MVP library with annotation processing and bytecode weaving. EasyMVP eliminates the boilerplate code for dealing w

null 1.3k Nov 19, 2022
MVVM framework for Android

RoboMVVM - MVVM Framework For Android RoboMVVM is an open source library that facilitates the use of the MVVM pattern in Android apps. The MVVM patter

Debdatta Basu 55 Nov 24, 2020
kotlin-core - A full framework for making Android apps. Based on Anko and Kotson.

kotlin-core This package is not Android-specific, and can be used across platforms. However, for a good example of use in Android, take a look at kotl

Lightning Kite 36 Oct 3, 2022
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Codename One - Cross Platform Native Apps with Java or Kotlin Codename One is a mobile first cross platform environment for Java and Kotlin developers

Codename One 1.4k Dec 23, 2022
🔥 Android component-based routing framework

README-CN Latest version module krouter-core krouter-compiler krouter-annotation krouter-plugin version Features 支持通过路由获取intent 支持方法注解,通过路由调用方法 支持给fra

Jiaming Gu 6 Jun 24, 2022
VasSonic is a lightweight and high-performance Hybrid framework developed by tencent VAS team, which is intended to speed up the first screen of websites working on Android and iOS platform.

VasSonic: A Lightweight And High-performance Hybrid Framework VasSonic is a lightweight and high-performance Hybrid framework developed by tencent VAS

Tencent 11.6k Dec 30, 2022
🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

?? AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android??

Pumpkin 325 Nov 22, 2022