Follow these instructions to get apktool installed for your platform: http://ibotpeaches.github.io/Apktool/install/
Download dex2jar and add it to your path: https://bitbucket.org/pxb1988/dex2jar/downloads
Download JD from: http://jd.benow.ca/
import android.app.Activity; | |
import android.app.Instrumentation; | |
import android.app.KeyguardManager; | |
import android.app.KeyguardManager.KeyguardLock; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.IBinder; | |
import android.os.PowerManager; | |
import android.os.PowerManager.WakeLock; | |
import android.support.test.InstrumentationRegistry; |
public class MyActivity extends Activity { | |
private static final String STATEFUL_COUNT = “count”; | |
private int count; | |
@Override | |
public void onCreate(Bundle savedInstance) { | |
super.onCreate(savedInstanceState); | |
if (savedInstanceState != null) { |
Follow these instructions to get apktool installed for your platform: http://ibotpeaches.github.io/Apktool/install/
Download dex2jar and add it to your path: https://bitbucket.org/pxb1988/dex2jar/downloads
Download JD from: http://jd.benow.ca/
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
/** | |
* The smarter thing to do would be to use what is Guava, etc...but Guava is a big fat library that | |
* will blow the dex count and this is pretty much the only thing we are using out of it. |
repositories { | |
... | |
flatDir { | |
dirs 'aars' | |
} | |
... | |
} | |
dependencies { | |
... |
// ------------------------------------------------------------------------ | |
// App code: These classes that describe the state of executing a query | |
// that we want to consume as a stream of events. | |
public class Loading { | |
} | |
public class Results<T> { | |
final List<T> results; |
android { | |
productFlavors { | |
app { | |
} | |
appFast { | |
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin | |
// to pre-dex each module and produce an APK that can be tested on | |
// Android Lollipop without time consuming dex merging processes. | |
minSdkVersion 21 |
// Put this at the end of your project build.gradle | |
// Execute on your CI server with something like: | |
// ./gradlew continuousIntegration -Pfingerprint=asdf -PbuildNumber=2 -PdisablePreDex | |
evaluationDependsOnChildren(); | |
task staticAnalysis() { | |
def appProject = subprojects.find { project -> 'app' == project.name } | |
dependsOn appProject.getTasksByName('findbugs', true) |
@Singleton | |
@Component(modules = { | |
AndroidModule.class, | |
BusModule.class, | |
NetworkModule.class, | |
AppModule.class | |
}) | |
public interface ApplicationComponent { | |
... | |
Bus bus(); |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... | |
BarcodeLoggerActivityPermissionsDispatcher.startBarcodeCaptureWithCheck(this); | |
} | |
@NeedsPermission(Manifest.permission.CAMERA) | |
void startBarcodeCapture() { | |
int orientation = WindowManagerHelper.getCurrentAccurateOrientation(this); | |
Intent intent = CaptureActivity.buildIntent(this, orientation); |