Take photo w/ camera intent and display in imageView or textView?

I have a question about how to take an image using the camera intent (or camera API) and then bring the image into an imageView for me to display in my application. This is what I have so far. I setup a button Button btnPicture = (Button) findViewById(R.id.btn_picture); btnPicture.setOnClickListener(this); I setup a Camera method private […]

Uploading images to a PHP server from Android

I need to upload an image to a remote PHP server which expects the following parameters in HTTPPOST: *$_POST[‘title’]* *$_POST[‘caption’]* *$_FILES[‘fileatt’]* Most of the internet searches suggested either : Download the following classes and trying MultiPartEntity to send the request: apache-mime4j-0.5.jar httpclient-4.0-beta2.jar httpcore-4.0-beta3.jar httpmime-4.0-beta2.jar OR Use URLconnection and handle multipart data myself. Btw, I am […]

Increment Android build number in Continuous Integration

I’m using Android Studio, Gradle, git. On every push to the master branch I want to build a new App version that’s uploaded to the Alpha channel of the Google Play Store. For this I need to increase the versionCode of the App for every build. For this I seem to have several choices: Increase […]

How do I open react-native's dev menu on real device

I have seen already a number of border cases and strange developer interface. From the “shake your device”, which is really impractical, specially with a tablet To working around Android studio to simulate a button press. Is there a consistent way to do it? Can’t we use a intern API to have a debug button […]

Are new threads automatically assigned to a different CPU Core in Java?

In Java, and more specifically, Android, are new Threads automatically assigned to a different CPU core than the one I am currently utilizing, or should I take care of that? Also, does it matter how the new thread is created, using the Thread class or submitting a Runnable to an Executor, that maintans a pool […]

How to provide login credentials to an automated android test?

I’m looking for a way to “provide a login” to my app so an automated test “is logged in” and can test the entire app. Currently it’s of course blocked by the login-screen. Because I’m using SmartLock for Passwords, this might be a chance to provide some credentials for the test – but I don’t […]

Android Tab Action Bar

I am trying out on the android action bar for 3.0, where I refer to The code in the TabsActivity are as follow: package com.test.actionbar; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; public class TabsActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ActionBar.Tab […]

How can I get the line number where the exception was thrown using Thread.UncaughtExceptionHandler?

When I use a try-catch block to catch an exception, I can get the line number where the exception was thrown by calling e.getStackTrace(). Like this: java.lang.NumberFormatException: Invalid int: “abc” java.lang.Integer.invalidInt(Integer.java:138) java.lang.Integer.parse(Integer.java:375) java.lang.Integer.parseInt(Integer.java:366) java.lang.Integer.parseInt(Integer.java:332) com.example.getarea.MainActivity.onCreate(MainActivity.java:42) android.app.Activity.performCreate(Activity.java:5066) android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1102) android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288) android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368) android.app.ActivityThread.access$600(ActivityThread.java:151) android.app.ActivityThread$H.handleMessage(ActivityThread.java:1330) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loop(Looper.java:155) android.app.ActivityThread.main(ActivityThread.java:5536) java.lang.reflect.Method.invokeNative(Native Method) java.lang.reflect.Method.invoke(Method.java:511) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841) dalvik.system.NativeStart.main(Native Method) But when I use […]

gradle force build tools version on third party libraries?

how can I force a library to use sdk build tools 19.1.0 or above without forking/manually editing the build.gradle file for the library? I keep getting this error when using libraries… Error:The SDK Build Tools revision (…….) is too low for project ‘:somelibrary’. Minimum required is 19.1.0

Changing android application language

This question already has an answer here: Change language programmatically in Android 26 answers

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