android.app.Application Java Examples

The following examples show how to use android.app.Application. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: firebase-android-sdk   Author: firebase   File: PicassoModule.java    License: Apache License 2.0 8 votes vote down vote up
@Provides
@FirebaseAppScope
Picasso providesFiamController(
    Application application, PicassoErrorListener picassoErrorListener) {
  okhttp3.OkHttpClient client =
      new OkHttpClient.Builder()
          .addInterceptor(
              new Interceptor() {
                @Override
                public Response intercept(Chain chain) throws IOException {
                  return chain.proceed(
                      chain.request().newBuilder().addHeader("Accept", "image/*").build());
                }
              })
          .build();

  Picasso.Builder builder = new Picasso.Builder(application);
  builder.listener(picassoErrorListener).downloader(new OkHttp3Downloader(client));
  return builder.build();
}
 
Example #2
Source Project: GAlette   Author: uPhyca   File: GAletteInstrumentationTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void weaveSendAppView() throws Exception {
    // Process classes.
    processClass("com.uphyca.galette.GAletteInstrumentationTest$TestClassForSendAppView");

    // Load instrumented classes.
    TestClassForSendAppView instrumentedObject = new TestClassForSendAppView();
    Application app = new Application();
    instrumentedObject.attach(app);

    // Invoke method.
    instrumentedObject.show();

    // Verify interactions.
    Method method = instrumentedObject.getClass().getDeclaredMethod("show", new Class[]{});
    verify(galette).sendAppView(eq(instrumentedObject), eq(app), eq(method), eq(new Object[]{}));
}
 
Example #3
Source Project: applivery-android-sdk   Author: applivery   File: AppliverySdk.java    License: Apache License 2.0 6 votes vote down vote up
private static void initializeAppliveryConstants(Application app, String appToken,
    boolean isStoreRelease) {

  //region validate some requirements
  Context applicationContext = Validate.notNull(app, "Application").getApplicationContext();
  Validate.notNull(applicationContext, "applicationContext");
  Validate.hasInternetPermissions(applicationContext, false);
  //endregion

  AppliverySdk.appToken = appToken;
  AppliveryDataManager.INSTANCE.setAppToken(appToken);
  AppliverySdk.isStoreRelease = isStoreRelease;

  AppliverySdk.fileProviderAuthority = composeFileProviderAuthority(app);

  AppliverySdk.applicationContext = applicationContext;

  AppliverySdk.appliveryApiService = AppliveryApiServiceBuilder.getAppliveryApiInstance();
  AppliverySdk.activityLifecycle = new AppliveryActivityLifecycleCallbacks(applicationContext);
  AppliverySdk.permissionRequestManager =
      new AndroidPermissionCheckerImpl(AppliverySdk.activityLifecycle);
}
 
Example #4
Source Project: imsdk-android   Author: qunarcorp   File: QTalkSearchRNViewInstanceManager.java    License: MIT License 5 votes vote down vote up
public static boolean buildBundle(Application application){
    boolean is_ok = false;

    try {
        ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
                .setApplication(application)
                .setJSMainModulePath("index")
                .addPackage(new MainReactPackage())
                .addPackage(new SearchReactPackage())
                .addPackage( new SvgPackage())
                .addPackage(new RNI18nPackage())
                .setUseDeveloperSupport(CommonConfig.isDebug)
                .setInitialLifecycleState(LifecycleState.RESUMED);

        String localBundleFile = getLocalBundleFilePath(application);

        File file = new File(localBundleFile);
        if (file.exists()) {
            // load from cache
            builder.setJSBundleFile(localBundleFile);
        } else {
            // load from asset
            builder.setBundleAssetName(JS_BUNDLE_NAME);
        }

        mReactInstanceManager = builder.build();

        is_ok = true;
    }catch (Exception e){

    }

    return is_ok;
}
 
Example #5
Source Project: rxjava-RxLife   Author: liujingxing   File: MyViewModel.java    License: Apache License 2.0 5 votes vote down vote up
public MyViewModel(@NonNull Application application) {
    super(application);
    Observable.interval(1, 1, TimeUnit.SECONDS)
        .as(RxLife.asOnMain(this))
        .subscribe(aLong -> {
            Log.e("LJX", "MyViewModel aLong=" + aLong);
        });
}
 
Example #6
Source Project: PeriscopeLayout   Author: AlanCheen   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #7
Source Project: ColorPicker   Author: xdtianyu   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #8
Source Project: LinkTextView   Author: zekunyan   File: ApplicationTest.java    License: MIT License 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #9
Source Project: slf4android   Author: bright   File: NotifyDeveloperHandler.java    License: MIT License 4 votes vote down vote up
NotifyDeveloperHandler(Application context, Iterable<String> emailAddress, ActivityStateListener activityState) {
    this(context, emailAddress, LogLevel.ERROR, activityState);
}
 
Example #10
Source Project: deagle   Author: oasisfeng   File: Applications.java    License: Apache License 2.0 4 votes vote down vote up
public static Application getCurrent() {
    return CURRENT;
}
 
Example #11
Source Project: clip-image   Author: msdx   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #12
Source Project: altex-image-downloader   Author: artjimlop   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
  super(Application.class);
}
 
Example #13
Source Project: android-ActionSheet   Author: baoyongzhang   File: ApplicationTest.java    License: MIT License 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #14
Source Project: AndroidStudyDemo   Author: DIY-green   File: ApplicationTest.java    License: GNU General Public License v2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #15
Source Project: RxjavaRetrofitDemo-master   Author: wzgiceman   File: RxRetrofitApp.java    License: MIT License 4 votes vote down vote up
public static void init(Application app){
    setApplication(app);
    setDebug(true);
}
 
Example #16
Source Project: Kernel-Tuner   Author: pedja1   File: ApplicationTest.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ApplicationTest()
{
    super(Application.class);
}
 
Example #17
Source Project: AndroidStudyDemo   Author: DIY-green   File: ApplicationTest.java    License: GNU General Public License v2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #18
Source Project: ContentResolverDemo   Author: goodbranch   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
  super(Application.class);
}
 
Example #19
Source Project: AndroidDemoProjects   Author: PaulTR   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #20
Source Project: OverscrollScale   Author: dodola   File: ApplicationTest.java    License: MIT License 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #21
Source Project: Barricade   Author: mutualmobile   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
  super(Application.class);
}
 
Example #22
Source Project: Clip-Stack   Author: heruoxin   File: ApplicationTest.java    License: MIT License 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #23
Source Project: BouncyEditText   Author: zzz40500   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #24
Source Project: mollyim-android   Author: mollyim   File: ViewOnceMessageManager.java    License: GNU General Public License v3.0 4 votes vote down vote up
@AnyThread
@Override
protected void scheduleAlarm(@NonNull Application application, long delay) {
  setAlarm(application, delay, ViewOnceAlarm.class);
}
 
Example #25
Source Project: android-notification-log   Author: interactionlab   File: ApplicationTest.java    License: MIT License 4 votes vote down vote up
public ApplicationTest() {
	super(Application.class);
}
 
Example #26
Source Project: twittererer   Author: zfoltin   File: ApplicationModule.java    License: Apache License 2.0 4 votes vote down vote up
ApplicationModule(Application application) {
    this.application = application;
}
 
Example #27
Source Project: mini-hacks   Author: couchbaselabs   File: Foreground.java    License: MIT License 4 votes vote down vote up
public static Foreground get(Application application){
    if (instance == null) {
        init(application);
    }
    return instance;
}
 
Example #28
Source Project: CreditCardView   Author: Movile   File: ApplicationTest.java    License: MIT License 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}
 
Example #29
Source Project: react-native-navigation   Author: wix   File: NavigationReactNativeHost.java    License: MIT License 4 votes vote down vote up
@SuppressWarnings("WeakerAccess")
public NavigationReactNativeHost(Application application) {
    super(application);
}
 
Example #30
Source Project: android-mvvm   Author: manas-chaudhari   File: ApplicationTest.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationTest() {
    super(Application.class);
}