Skip to content

Instantly share code, notes, and snippets.

@imojams
Created December 5, 2016 08:40
Show Gist options
  • Save imojams/00fcb5601420e3189ecce9c6a60f488f to your computer and use it in GitHub Desktop.
Save imojams/00fcb5601420e3189ecce9c6a60f488f to your computer and use it in GitHub Desktop.
Java files
package lv.akg.evolvtestwrapper;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class EvolvTestWrapperAct extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_evolv_test_wrapper);
Log.d("evolvtestwrapper", "++++++++++++++++++++++++++++++++++++++++++++++ Starting wrapper app");
DynamicApp.init(this, "app.apk");
Log.d("evolvtestwrapper", "DynamicApp.init() finished");
/* Start App by calling this activity. It is the entry point for the new
* application.
*
* THIS ACTIVITY MUST BE DECLARED IN THE ANDROID MANIFEST
*/
startApp("lv.akg.evolvtest.MainActivity");
Log.d("evolvtestwrapper", "startApp() finished");
//Close this activity so the user doesn't see it when they close the app.
finish();
}
public void startApp(String className) {
try {
System.out.println("startApp() ++++++++++++++++++++++++++++++++++++++++++++++Starting App With " + className);
Intent intent = new Intent(this, Class.forName(className, false, DynamicApp.classLoader));
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
}
package lv.akg.evolvtest;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import com.vivekpanyam.evolve.DynamicActivity;
import com.vivekpanyam.evolve.Evolve;
public class MainActivity extends DynamicActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("evolvtest","EvolveTest setting evolve to debug mode");
Evolve.setDebug(true);
String updateServer = "http://192.168.220.104/testapp/";
//http://stackoverflow.com/a/21119027 (BuildConfig.VERSION_CODE)
Evolve.setValues(String.format("%sapp.apk?androidVersion=%s&appVersion=%s", updateServer, Build.VERSION.RELEASE, BuildConfig.VERSION_CODE), String.format("%sversion.txt?androidVersion=%s",updateServer,Build.VERSION.RELEASE));
Log.d("evolvtest", Build.VERSION.RELEASE);
setTitle("evolvtest");
Evolve.checkForUpdate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment