Category Archives: 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… Read More »

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… Read More »

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… Read More »

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,… Read More »

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… Read More »

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), “baduser@gmail.com”); 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.