Populate spinner with years dynamically in Android?

I have been racking my brain trying to get this to work. I want to dynamically enter in years from 1900 to the current year into a spinner. I don’t think that this is possible to do using an XML defined array but can I do it with an array adapter? Here is what I […]

Can't update to Android Studio gradle 1.4 plugin

In my build.gradle I have: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.4.+’ } } However I’m getting: Error:Could not find com.android.tools.build:gradle:1.4.+. Searched in the following locations: file:/C:/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.pom file:/C:/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.jar https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.pom https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.jar Required by: :xxx:unspecified What to do?

Android – getIdentifier always returns 0 (library +application)

I have Android project (com.appocaliptic.quizknife.app) which uses Android library (com.appocaliptic.quizknife.core). What I am trying to do, is to get resource id of the picture which is the library. Path to the image is: res/drawable-xhdpi/fr_200_133.png However, all tries with getIdentifier result 0. Where is the problem? resId = getResources().getIdentifier(“fr_200_133”, “drawable”, “com.appocaliptic.quizknife.core”); resId = getResources().getIdentifier(“com.appocaliptic.quizknife.core:drawable/”+”fr_200_133”, null, null); […]

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file

I get the following error while trying to compile an Android NDK project: ndk-build Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /home/lambergar/work/APIExample/jni/Android.mk /home/lambergar/android/ndk/android-ndk-r5c/build/core/add-application.mk:116: *** Android NDK: Aborting… . Stop. The weird thing is, that the ‘unknown file’ (Android.mk) exists under the path reported as invalid.

How to create 9 patch in Photoshop? What is 9.png encoding?

Provided utility looks bad, for example it does not allow to do “Save As”, or to draw several button states with similar slicing. Is it possible to draw 9.png in photoshop? I noticed, that generated png just contains black pixels in outer edge. Is this what is marking the slices? What if black pixels present […]

How to clear all rows from a TableLayout?

I know that this has already been asked before, but none of the other responses have helped me, so I’ll ask myself… I am trying to delete all my existing rows from a TableLayout because I want the user to be able to update the table dynamically. Other suggestions have recommended using removeAllViews(), which is […]

Cordova: Is it possible to have different app IDs for android and ios platforms?

Let’s say I have a Cordova application with an id of com.StackOverflowExample.MyQuestion, which I created with Cordova 3 using the CLI (cordova create). I have added iOS and Android platforms for my app, and have submitted the app to Apple and to Google Play. Now, however, after submitting my app to Play, I seem to […]

To Display the Google map on the emmulator

Now I am working on the Google maps API. I am not able to display the map on the emulator as well as the device……… how can i dis play the map. I tried like this but i failed… I searched for the debug.keystore in c:/ i found it. I got Keytool.exe from the “C:\Program […]

Customizing the setError icon for TextView

I want to set a setError method to my TextView, with a custom icon instead of the default Android icon. So I tried this: ((EditText)findViewById(R.id.edtTitle)).setError(getResources().getText(R.string.errEmptyTitle), getResources().getDrawable(R.drawable.ico_warning_small); It shows me the custom message, but not the custom icon. I tried this as well: Drawable warning = (Drawable)getResources().getDrawable(R.drawable.ico_warning_small); ((EditText)findViewById(R.id.edtTitle)) .setError(getResources().getText(R.string.errEmptyTitle), warning); Pretty much the same, but I […]

Different text size for different hardware

I have a edit text layout as below and I want to know, is there any way to provide different size for it for different hardware depending on its screen size? For screens below 4 inches I want to give the below layout <EditText android:id=”@+id/entry” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:background=”@android:drawable/editbox_background” android:textColor=”#800080″ android:text=”” android:hint=” No Operator Precednce yet” […]

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