Tag: java

Set windowTranslucentStatus=true when android lollipop or higher

I’d like to set windowTranslucentStatus to true when the user is on lollipop and above because otherwise (at least on kitkat) the app bar appears inside the system bar. On lollipop it is fine. Without making separate styles.xml for each version which apparently you shouldn’t have to do anymore how can I set it in […]

Should I use “_activity = this;”?

Should I use “_activity = this;“? I’ve seen _activity referenced many times in sample code. So, I arbitrarily decided that it looked like a good practice and have been using in all my code for awhile (over a year). But, before I start spreading the word around more I wanted to find some proper documentation […]

Google Drive SDK Activity Not Found Exception

I am trying to implement Stephen Wylie’s Google Drive example (here). Here is my code: package com.googledrive.googledriveapp; // For Google Drive / Play Services // Version 1.1 – Added new comments & removed dead code // Stephen Wylie – 10/20/2012 import java.io.IOException; import java.util.ArrayList; import android.accounts.Account; import android.accounts.AccountManager; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import […]

Skip Eclipse validation of build.xml

I’ve followed the steps given in the Android Developer Blog to generate a build.xml for building releases for an Android Application. I need to do a custom compiling so I have overwritten the target compile of the ant_rules_r3.xml as it is said in the generated build.xml. <target name=”compile” depends=”-resource-src, -aidl, -pre-compile” … The script works […]

IntelliJ IDEA IDE for Android development

Hey guys, does anyone has an experience with Android development with intelliJ IDEA IDE? Does it suit all the needs?

Calling System.loadLibrary twice for the same shared library

I have the situation when two jar libraries use the same shared library. In each library “the main interface” class loads the .so file with System.loadLibrary. My question is: if the user decides to use these two jar libraries in one project, would the second call to System.loadLibrary for the same .so file cause any […]

How to align EditText cursor properly?

I have an edit text with a 200sp size. The cursor appears in the middle. How can I make sure the cursor appears in the left corner? It looks odd being in the center. <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <EditText android:layout_width=”match_parent” android:layout_height=”wrap_content” android:id=”@+id/composeEditText” android:minHeight=”200sp” android:focusable=”true” android:hint=”Share an idea with the community”></EditText> […]

android admob resize on landscape

I have declared adMob on manifest like <activity android:name=”com.google.ads.AdActivity” android:configChanges=”keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize” /> It is resized properly when device rotacion but now I must add android:configChanges=”keyboardHidden|orientation” to activity that contains adMob in order to prevent activity reloading. I am reaching it but now adMob is not scaled when landscape. onConfigChanges event I could now force adMob to […]

java.lang.IllegalStateException: This feature is only available to backend instances

In my api explorer I get following error while performing an insert to an endpoint, which inserts some data to firebase. 503 – Show headers – { “error”: { “errors”: [ { “domain”: “global”, “reason”: “backendError”, “message”: “java.lang.IllegalStateException: This feature is only available to backend instances.” } ], “code”: 503, “message”: “java.lang.IllegalStateException: This feature is […]

error in activity.java for phonegap

I am just configuring my phonegap application and set to run “HelloWorld” Problem. But i cant execute it properly since it always throws me the following error. Cannot reduce the visibility of the inherited method from DroidGap The import com.phonegap cannot be resolve And here is my Code in MainActivity.java package com.example.mobile; import org.apache.cordova.DroidGap; import […]

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