Search in sources :

Example 71 with Application

use of android.app.Application in project Genius-Android by qiujuer.

the class KitActivity method init.

private void init() {
    //Application kitApp = Kit.getApplication();
    Application application = getApplication();
    //showLog(TAG, "Kit.getApplication() eq getApplication() is:" + (kitApp == application));
    Cmd.init(application);
}
Also used : Application(android.app.Application)

Example 72 with Application

use of android.app.Application in project robospice by stephanenicolas.

the class InFileWeatherPersisterTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Application application = (Application) getContext().getApplicationContext();
    Jackson2ObjectPersisterFactory factory = new Jackson2ObjectPersisterFactory(application);
    dataPersistenceManager = factory.createObjectPersister(WeatherResult.class);
}
Also used : WeatherResult(com.octo.android.robospice.springandroid.test.model.json.WeatherResult) Application(android.app.Application)

Example 73 with Application

use of android.app.Application in project robospice by stephanenicolas.

the class InFileWeatherPersisterTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Application application = (Application) getContext().getApplicationContext();
    SimpleSerializerObjectPersisterFactory factory = new SimpleSerializerObjectPersisterFactory(application);
    dataPersistenceManager = factory.createObjectPersister(Weather.class);
    TEST_TEMP.setTemp("28");
    TEST_TEMP.setTemp_unit("C");
    TEST_TEMP.setWind(new Wind());
    TEST_TEMP2.setTemp("30");
    TEST_TEMP2.setTemp_unit("C");
    TEST_TEMP2.setWind(new Wind());
}
Also used : Weather(com.octo.android.robospice.springandroid.test.model.xml.Weather) Wind(com.octo.android.robospice.springandroid.test.model.xml.Wind) Application(android.app.Application)

Example 74 with Application

use of android.app.Application in project robospice by stephanenicolas.

the class InFileWeatherPersisterTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Application application = (Application) getContext().getApplicationContext();
    GsonObjectPersisterFactory factory = new GsonObjectPersisterFactory(application);
    dataPersistenceManager = factory.createObjectPersister(WeatherResult.class);
}
Also used : WeatherResult(com.octo.android.robospice.springandroid.test.model.json.WeatherResult) Application(android.app.Application)

Example 75 with Application

use of android.app.Application in project robospice by stephanenicolas.

the class InFileStringObjectPersisterTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Application application = (Application) getContext().getApplicationContext();
    inFileStringObjectPersister = new InFileStringObjectPersister(application);
}
Also used : Application(android.app.Application)

Aggregations

Application (android.app.Application)125 Test (org.junit.Test)27 Context (android.content.Context)24 Activity (android.app.Activity)23 ApplicationInfo (android.content.pm.ApplicationInfo)12 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)11 File (java.io.File)10 MvpPresenter (com.hannesdorfmann.mosby3.mvp.MvpPresenter)8 Before (org.junit.Before)8 ShadowApplication (org.robolectric.shadows.ShadowApplication)8 MvpView (com.hannesdorfmann.mosby3.mvp.MvpView)7 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)6 PrintWriter (java.io.PrintWriter)6 Date (java.util.Date)6 SuppressLint (android.annotation.SuppressLint)5 PackageInfo (android.content.pm.PackageInfo)5 PackageManager (android.content.pm.PackageManager)5 RemoteException (android.os.RemoteException)5 AbsoluteSizeSpan (android.text.style.AbsoluteSizeSpan)5 AndroidRuntimeException (android.util.AndroidRuntimeException)5