How can I get the direction of movement using an accelerometer?

I’m developing a Android application and I would like to know if is possible detect the direction of movement with one axis fixed. For example, I want put my phone on the table and detect the direction when I move it (left, right, up and down). The distance is not necessary, I just want know […]

access files from assets/www directory

let’s say I’ve got a file called foo.html sitting (quite comfortable) in my assets/www directory (next to my index.html). I’d like to copy that file to another location on the device. My first approach window.resolveLocalFileSystemURI(“foo.html”, cool(), notCool());is not working. Also with a prefix like www/ it won’t. It would be interesting to know if it […]

Need to use Team Foundation client in Android Studio probable alternatives/workarounds?

I have a scenario wherein. I need to use android studio as IDE and Team foundation Server as source control repository. The problem is there is no plugin for TFS in android studio. And there is no standalone client for TFS(Windows) I tried using Tortoise SVN with SvnBridge to connect to TFS. But it does […]

Get image Uri in onActivityResult after taking photo?

I have this code: startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), CAMERA_IMAGE); That allows that user to take a photo. Now how would I get the Uri of that photo in onActivityResult? Is it an Intent extra? Is it through Intent.getData()?

How to change android slidingdrawer handle button position

In default handle button in android SlidingDrawer in the centre of the drawer. Is it possible to change that position to left or right..? If it possible how can I do that, android:gravity=”left” is not work in the button.

GCM FC / sender id not set on constructor

I have gotten some strange StackTraces from users of my app recently: Android Version: 2.3.5 Phone Model: GT-I9001 Stacktrace: java.lang.IllegalStateException: sender id not set on constructor at com.google.android.gcm.GCMBaseIntentService.getSenderIds(GCMBaseIntentService.java:125) at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:237) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.os.HandlerThread.run(HandlerThread.java:60) I am using Rev. 3 of the GCM lib and regarding to the documentation the senderID is […]

problems after installing java 8

Android Studio had a popup telling updates was available after i run the SDK manager and started the Android Studio again I got another popoup that toke me to Androids website where it told me that I should upgrade to Java JDK 8 and JRE 8 after I did i got over 235 errors when […]

Android Canvas Clear with transparency

I am trying to “erase” from a canvas. Just as a VERY simple test of clearing a canvas, I have implemented the following: @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawColor(Color.argb(140, 0, 0, 0)); canvas.drawColor(0, Mode.CLEAR); } Color.argb(140, 0, 0, 0) sets the view this view is drawn over to be dimmed. drawColor(0, Mode.CLEAR) makes […]

Android: 2 or more ExpandableListView inside Navigation Drawer

How could I do something like this? Two expandable listview inside navigation drawer. I tryed to add it inside my xml but without luck. What I want is a view with only one scrollbar, but I don’t’ know how to do it.. this is my navigation drawer layout: <?xml version=”1.0″ encoding=”utf-8″?> <ScrollView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:background=”@color/Bianco” […]

Android: EditText.setInputType() how to setup for email but not auto-suggest

I am using an EditText box for user to enter their email address. I set it up using: box.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS ); This results in the soft keyboard popping up with the ‘@’ and ‘.’ (and some keyboards ‘.com’) keys on the initial keyboard layout. Great just what I want. However, I notice the […]

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