Tag: java

R.java is not generating due to appcompat v7?

I am using Eclipse, I added the appcompat lib to my project ands suddenly the R.java file is not generating. But in my Console it is showing like this whenever i clean the project. [2014-11-02 18:50:16 – Client] G:\ProgramZ\workspace\android-support-v7-appcompat\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ActionButton.CloseMode’. [2014-11-02 […]

Runtime Exception while using the Settings in Android (I am following the udacity Android Developer course)

I am new to android and following the Udacity Android developer course to learn. I am on chapter 3 where they teach about the adding the settings in your app. I have added the SettingActivity from android studio. When I click on settings menu, my app crashes. This is my pref_general.xml file <PreferenceScreen xmlns:android=”http://schemas.android.com/apk/res/android”> <!– […]

How to create folders in google drive without duplicate?

the question is: How to create folders in google drive without duplicate? I’m answering the question in this post, and I want to share this code with anyone who is searching for a similar solution or problem to solve.

Dragging multiple button views in java

I have an app where I need to move stacks of buttons (just like moving part of a stack of cards from one pile to another). I have defined all the buttons in an xml layout and setup touch and drag listeners for all. I can drag and drop any button around the screen individually. […]

Flurry Agent causing a CalledFromWrongThreadException exception on Android 2.3.4

When I use the FlurryAgent on a 2.3.4 device I get the following exception: E/AndroidRuntime: FATAL EXCEPTION: FlurryAgent android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. In my code I made sure everything that is UI related is done on the UI thread. I’ve tried disabling Flurry’s exception capture […]

Activity extending ActionBarActivity and YouTubeBaseActivity

In my application I need to getSupportActionBar() in order to change its title and enable home as back button. I also need to have a YouTubePlayerView to display a video. I cannot extend ActionBarActivity and YouTubeBaseActivity in the same time. What is the proper way to solve such problem?

Android AltBeacon Background Service Ranging

I am working on a bluetooth app using the AltBeacon library. It seems that only on instance of the BeaconManager is allowed per application. The problem I am facing is this: I want a continuously running background service that constantly does bluetooth ranging and sends notifications. If I open my app (bring it to foreground) […]

How to chain multiple RxJava's groupBy() methods such as groupBy().groupBy()

Given input: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] Group the numbers by odd or even and then by less than or greater than 5. Expected output: [[1, 3, 5], [2, 4], [6, 8, 10], [7, 9]] The order of the output isn’t restricted. I’m now using the following approach: Observable.range(1, 10) […]

Store, convert to video an stream Android screen

I use DDMS to get screenshots from my Android phone and I need an efficient way for converting them in video and streaming the video over the network. I have a RawImage which is filled with the data of the screenshot: RawImage mRawImage; Until know I use SWT to create the image and save it: […]

java.lang.UnsatisfiedLinkError – NDK in android studio gradle?

Folder structure app —main —java —-jni —–Android.mk —–Application.mk —– hello-jni.c —res in build.gradle apply plugin: ‘com.android.application’ android { compileSdkVersion 21 buildToolsVersion “22.0.1” defaultConfig { applicationId “com.example.hellojni” minSdkVersion 17 targetSdkVersion 21 sourceSets.main { jni.srcDirs = [] jniLibs.srcDir ‘src/main/libs’ } ndk { moduleName “hello-jni” cFlags “-std=c++11 -fexceptions” ldLibs “log” stl “gnustl_shared” abiFilter “armeabi-v7a” } task nativeLibsToJar(type: Zip, […]

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