How to output messages to the Eclipse console when developing for Android

How can I print messages (like a flag) to the Eclipse console (or log) when developing and debugging an Android app

This version of the application is not configured for billing through Google Play

When I try to run my application with in-app billing I am getting the error: “This version of the application is not configured for billing through Google Play. Check the help center for more information”. I have the billing permission already in the Manifest file and I have a signed .apk uploaded as a draft […]

How to handle notification when app in background in Firebase

Here is my manifest <service android:name=”.fcm.PshycoFirebaseMessagingServices”> <intent-filter> <action android:name=”” /> </intent-filter> </service> <service android:name=”.fcm.PshycoFirebaseInstanceIDService”> <intent-filter> <action android:name=”” /> </intent-filter> </service> When the app is in background and notification arrives then the default notification comes and doesn’t run my code of onMessageReceived. Here is my onMessageReceived code. This invokes if my app is running on foreground, […]

How to capture the “virtual keyboard show/hide” event in Android?

I would like to alter the layout based on whether the virtual keyboard is shown or not. I’ve searched the API and various blogs but can’t seem to find anything useful. Is it possible? Thanks!

GridLayout (not GridView) how to stretch all children evenly

I want to have a 2×2 grid with a buttons inside. This is only ICS so I am trying to use the new GridLayout given. Here’s the XML of my layout: <?xml version=”1.0″ encoding=”utf-8″?> <GridLayout xmlns:android=”” android:id=”@+id/favorites_grid” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”#00ff00″ android:rowCount=”2″ android:columnCount=”2″> <Button android:text=”Cell 0″ android:layout_row=”0″ android:layout_column=”0″ android:textSize=”14dip” /> <Button android:text=”Cell 1″ android:layout_row=”0″ android:layout_column=”1″ android:textSize=”14dip” […]

Android LinearLayout Gradient Background

I am having trouble applying a gradient background to a LinearLayout. This should be relatively simple from what I have read but it just doesn’t seem to work. For reference sakes I am developing on 2.1-update1. header_bg.xml: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”” android:shape=”rectangle”> <gradient android:angle=”90″ android:startColor=”#FFFF0000″ android:endColor=”#FF00FF00″ android:type=”linear”/> </shape> main_header.xml: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”” […]

How to change the status bar color in android

First of all it’s not a duplicate as in How to change the background color of android status bar How do I change the status bar color which should be same as in navigation bar. I want the status bar color to be same as the navigation bar color

How do I find out which keystore was used to sign an app?

I have an app which is signed and several keystore files. I’d like to update the app, so I need to find out which one of keys was used. How can I match which keystore was used to originally sign my app against various keystores I have on my machine?

How to close Android application?

I want to close my application, so that it no longer runs in the background. How to do that? Is this good practice on Android platform? If I rely on the “back” button, it closes the app, but it stays in background. There is even application called “TaskKiller” just to kill those apps in the […]

Set margins in a LinearLayout programmatically

I’m trying to use Java (not XML) to create a LinearLayout with buttons that fill the screen, and have margins. Here is code that works without margins: LinearLayout buttonsView = new LinearLayout(this); buttonsView.setOrientation(LinearLayout.VERTICAL); for (int r = 0; r < 6; ++r) { Button btn = new Button(this); btn.setText(“A”); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); […]

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