What is the best way of create and test a library project in Android Studio to share in any project?

In Android Studio 1.0.1 you only have the initial option of create a new project but not a new library. I would like create a library that I can share with multiple and future apps. Must I create a new project and create library modules inside? Can create only a library project? If a library […]

Dialog FLAG_DIM_BEHIND doesn't work on Android 5.x (Lollipop)

I dim the background of a DialogFragment using this code: Window window = getDialog().getWindow(); WindowManager.LayoutParams windowParams = window.getAttributes(); windowParams.dimAmount = 0.75f; windowParams.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND; window.setAttributes(windowParams); This works fine on Kitkat and below, but stopped working on Lollipop. I suspect it has to do with the fact that my Activity is using the style Theme.AppCompat.Light.DarkActionBar, which […]

How to attach GestureDetector to a ListPreference?

The challenge of attaching a GestureDetector to a ListPreference is 2-fold: Getting a handle to a ListPreference that’s only defined in a preferences.xml (i.e. not instantiated in Java code). ListPreference is neither a View nor Activity subclass. Is it possible at all to attach a GestureDetector to a ListPreference? If so, how would one go […]

How to include Zxing library to android project?

I have read some answer for this question in stackoverflow, but it is not working for me. I have already a project, and now I want to integrate QR Code and barcode reader into my project. I downloaded the zip file from: core-2.2.zip I didn’t find any “core.jar”, I read that I have to integrate […]

Convert Text To Bitmap(Pixel) on Android

I have an android application in which I need to download text from a website, convert it into bitmap format and display it on an LED-based display board. I am struggling with the bitmap conversion. Tried to use the following: Bitmap mybitmap = Bitmap.createBitmap(100, 16, Bitmap.Config.ALPHA_8); Canvas c = new Canvas(mybitmap); c.drawText(“0”, 0, 0, paint); […]

How firebase persistence stores local data for my Android app

I am making an android app similar to WhatsApp. In the app users can send text as well as images. To save the messages so that they can be viewed offline I used : FirebaseDatabase.getInstance().setPersistenceEnabled(true); I was wondering how does firebase store messages offline. Does it create a local database similar to the commonly used […]

Activity can't be resumed

Over the past months I have been developing a versatile real-time game engine, and I have learned a lot, but I still feel very naive when it comes to the application life cycle. Specifically, I am trying to implement an Activity which can be shuffled in to the background by the user, then properly resumed. […]

Decoding h264 ByteStream on Android

I want to decode and display a raw h264 video byte stream in Android and therefore I’m currently using the MediaCodec/Format classes. I acquire the frame data via Udp from a server. But, unfortunately, nothing is displayed at the moment. Here is what I have so far. Initializing MediaCodec Class: codec = MediaCodec.createDecoderByType(“video/avc”); MediaFormat format […]

How download file with service in android?

I want download a file from internet with service. I found the source code and the code worked well. But i have a problem when i back from app the download are stopping or when i clear RAM, it also are stopping. So that i want found downloading code such as Google Play, which never […]

Facebook Game Requests – Object not owned by the app

I am trying to implement Facebook Game Requests to my Android App. GameRequestContent.Builder() needs to have .setObjectId() called, to use ActionType.SEND or ActionType.ASKFOR. Where do I get this object? When I try to create object using Object Manager or Object API I get this error in the Facebook dialog: Object type ‘Game’ for ID ‘xxxxxxxxxx’ […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.