Compile FFmpeg for Android

When you have to manipulate audio or video on Android, being used to open-source software, you have a single name which comes directly to you: FFmpeg. However, FFmpeg is a C software, meant to be used as an executable, and not officially supporting Android. There are a lot of partial and/or out-of-date how-to out there on how to get FFmpeg running on Android, like halfninja’s build. However, I needed to use FFmpeg concat demuxer, introduced in FFmpeg 1.1. Most builds target 0.9. There’s a ton of questions on StackOverflow about getting newer FFmpeg releases working on Android. So, here’s a full explanation to get FFmpeg 2.2.3 “Muybridge” working on Android. I’ll describe the steps for Linux, but everything is pretty standard shell and should work on any decent OS.

Read More…

Posted on

Android: display a Dialog from an AppWidget

Issue When you want to display a dialog, you don’t only need a context, you need an activity context. From an activity, displaying a dialog is pretty straightforward: Display a dialog from an activity new AlertDialog.Builder(MyActivity.this) .setTitle("Dialog title") .setMessage("Dialog message") .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Handle a positive answer } }) .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Handle a negative answer } }) .setIcon(R.drawable.ic_dialog_alert) .show(); Okay, that’s a pretty usual code sample. But what about displaying it from an app-widget?

Read More…

Posted on