Category: Android

  • Epson EF-12 Dolby Digital / DTS output on ARC

    The Epson EF-12 laser projector (Android TV) can output / passthrough 5.1 digital surround sound to your A/V home theater receiver over its HDMI2 ARC connection for both Dolby Digital AC3 and DTS movies & media using Kodi player, but with some big caveats. First, the settings in Kodi player to output 5.1 digital surround sound…

  • Android Genymotion Mock Location Google Play

    To get Android Genymotion Mock Location Google Play fused location provider working in an emulator these are the necessary components and steps.  (For Genymotion 2.5.x emulator versions) Download: Genymotion ARM Translation v1.1 Google Apps / Play Store for a Genymotion emulator running SDK 5.1 (API Level 22) Steps Install these two zipped APK archive files by…

  • Spring Boot SSL with Android Retrofit

    To setup Spring Boot SSL with Android Retrofit connecting on HTTPS 443: In Spring Boot <your project>/src/main/resources/application.properties – add the following values (not the “1.” which is just WordPress ordered list numbering) security.require-ssl=true server.port=8443 server.ssl.key-store=src/main/resources/private/keystore server.ssl.key-store-password=changeit server.ssl.key-password=changeit create and add an SSL key to the location specified by server.ssl.key-store. Note: the SSL certificate file is…

  • Android Studio Permanently Change Debug Configuration for Working Directory $MODULE_DIR$ and app:assembleDebugUnitTest

    On Mac OS X, Android Studio’s default debug Unit Test build configuration generally doesn’t run with default settings complaining that: AndroidManifest.xml not found or not a file; it should point to your project’s AndroidManifest.xml To fix this error you need to edit your debug configuration to set Working Directory as $MODULE_DIR$ and it makes builds…

  • Android AsyncTask return result

    To get Android AsyncTask to return a result use a callback method (Observer pattern) by following these steps. Define a constructor for our async class which extends AsyncTask (we’re required to subclass/extend AsyncTask for use). Let’s call our AsyncTask class MyAsyncTask. Constructor parameter takes a class which will handle the AsyncTask result.  Usually an Activity or Fragment,…

  • Retrofit error 415 400 object with Date field Fix @JsonFormat annotation

    Retrofit error 415 or error 400 on an object with a Date field can be fixed by using @JsonFormat annotation with the proper date pattern format specified in the annotation. java.util.Date toString() (for my locale/region) returns a string date format of MMM dd, yyyy hh:mm:ss aa Example: Oct 22, 2015 11:09:55 PM For Retrofit /…

  • Robolectric reference

    Robolectric Android testing Fragments and more private ReminderManagerFragment startReminderManagerFragment() { final ReminderManagerFragment fragment = new ReminderManagerFragment(); SupportFragmentTestUtil.startVisibleFragment(fragment); return fragment; } @Test public void reminderManagerTest() throws Exception { // by default there should be 3 Reminder rows ReminderManagerFragment fragment = startReminderManagerFragment(); assertThat(fragment).isNotNull(); Button addButton = (Button) fragment.getView().findViewById(R.id.reminder_add_button); assertThat(addButton).isNotNull(); List<Reminder> reminders = getReminders(TestValues.BillyUser); assertThat(reminders.size()).isEqualTo(3); // add a…

  • PendingIntent requestCode getBroadcast useless doesn’t work

    Android PendingIntent requestcode on getBroadcast() method is useless.  It won’t be used at all for making a unique PendingIntent. Use other fields such as Data (Intent.setData(“someStringPerhapsInteger.valueOf(RequestCode)”)) to make your PendingIntent unique for use with AlarmManager for Notifications for example. http://stackoverflow.com/a/33203752/2301224

  • Robotium reference

    Enter text EditText / text field solo.enterText((EditText) solo.getView(R.id.email_edittext), “[email protected]”); Click Button solo.clickOnButton(“Login”); Check for Toast Text Message assertTrue(solo.waitForText(getActivity().getResources() .getString(R.string.msg_login_failed)));     More to come…

  • Android Robolectric Support Fragment FragmentTestUtil

    To use Android Support Fragment v4 in Robolectric 3.0 you must add gradle dependency in /app/build.gradle testCompile ‘org.robolectric:shadows-support-v4:3.0’ Then import into your Robolectric testing java class import org.robolectric.shadows.support.v4.SupportFragmentTestUtil; then you can create/start android support v4 fragments within your Robolectric testing java class for unit testing: SupportFragmentTestUtil.startVisibleFragment(fragment); Cross posted to StackOverflow Android Robolectric Support Fragment.