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 File: PicassoModule.java From firebase-android-sdk with Apache License 2.0 | 8 votes |
@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 File: GAletteInstrumentationTest.java From GAlette with Apache License 2.0 | 6 votes |
@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 File: AppliverySdk.java From applivery-android-sdk with Apache License 2.0 | 6 votes |
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 File: QTalkSearchRNViewInstanceManager.java From imsdk-android with MIT License | 5 votes |
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 File: MyViewModel.java From rxjava-RxLife with Apache License 2.0 | 5 votes |
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 File: ApplicationTest.java From PeriscopeLayout with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #7
Source File: ApplicationTest.java From ColorPicker with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #8
Source File: ApplicationTest.java From LinkTextView with MIT License | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #9
Source File: NotifyDeveloperHandler.java From slf4android with MIT License | 4 votes |
NotifyDeveloperHandler(Application context, Iterable<String> emailAddress, ActivityStateListener activityState) { this(context, emailAddress, LogLevel.ERROR, activityState); }
Example #10
Source File: Applications.java From deagle with Apache License 2.0 | 4 votes |
public static Application getCurrent() { return CURRENT; }
Example #11
Source File: ApplicationTest.java From clip-image with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #12
Source File: ApplicationTest.java From altex-image-downloader with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #13
Source File: ApplicationTest.java From android-ActionSheet with MIT License | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #14
Source File: ApplicationTest.java From AndroidStudyDemo with GNU General Public License v2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #15
Source File: RxRetrofitApp.java From RxjavaRetrofitDemo-master with MIT License | 4 votes |
public static void init(Application app){ setApplication(app); setDebug(true); }
Example #16
Source File: ApplicationTest.java From Kernel-Tuner with GNU General Public License v3.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #17
Source File: ApplicationTest.java From AndroidStudyDemo with GNU General Public License v2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #18
Source File: ApplicationTest.java From ContentResolverDemo with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #19
Source File: ApplicationTest.java From AndroidDemoProjects with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #20
Source File: ApplicationTest.java From OverscrollScale with MIT License | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #21
Source File: ApplicationTest.java From Barricade with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #22
Source File: ApplicationTest.java From Clip-Stack with MIT License | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #23
Source File: ApplicationTest.java From BouncyEditText with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #24
Source File: ViewOnceMessageManager.java From mollyim-android with GNU General Public License v3.0 | 4 votes |
@AnyThread @Override protected void scheduleAlarm(@NonNull Application application, long delay) { setAlarm(application, delay, ViewOnceAlarm.class); }
Example #25
Source File: ApplicationTest.java From android-notification-log with MIT License | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #26
Source File: ApplicationModule.java From twittererer with Apache License 2.0 | 4 votes |
ApplicationModule(Application application) { this.application = application; }
Example #27
Source File: Foreground.java From mini-hacks with MIT License | 4 votes |
public static Foreground get(Application application){ if (instance == null) { init(application); } return instance; }
Example #28
Source File: ApplicationTest.java From CreditCardView with MIT License | 4 votes |
public ApplicationTest() { super(Application.class); }
Example #29
Source File: NavigationReactNativeHost.java From react-native-navigation with MIT License | 4 votes |
@SuppressWarnings("WeakerAccess") public NavigationReactNativeHost(Application application) { super(application); }
Example #30
Source File: ApplicationTest.java From android-mvvm with Apache License 2.0 | 4 votes |
public ApplicationTest() { super(Application.class); }