Tag: android

How to use android monkey

I am a little confused on how to actually use monkey, i thought you were supposed to power on your emulator and go into terminal editor and type: $ adb shell monkey -p insert.my.package.name.here -v 500 since that did not work (error, adb: permission denied) i tried monkey -p insert.blah.blah -v 500 and this comes […]

Increase volume of recording Android AudioRecord

I’m using AudioRecord and lame to record mic input to a mp3 sample for 12 seconds. The audio is recorder as expected but I realized the volume is too low. Is there a way to increase the volume of the recording?

Enabling CardEmulation on Android ICS with NFC_EXTRAS

I need help with NFC and Android. After making a lot of research to enable the emulation of a Mifare 4K on Android, I’ve found that the only patch that exists was made for 2.3.4. Here in StackOverFlow, NFCGuy told us since API 14 of Android it’s not neccesary patch the ROM, so we can […]

DataPicker looks like old design on new API's as well

So the problem is very simple: I have integrated a DatePicker in my application. Not as a DialogDatePicker but as a View component (more precisely a View inside of a Fragment that is dynamically shown and removed from a FrameLayout contained in my main FragmentActiviy layout.). now my problem is that this DataPicker looks like […]

Admobs needs permissions which I already have

I am trying to use AdMobs on Android. This is my manifest: <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.krinsen.javadocreader” android:versionCode=”2″ android:versionName=”1.0.1″ > <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”17″ /> <uses-permission android:name=”android.permission.INTERNET” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> <application android:name=”.app.SimpleApp” android:hardwareAccelerated=”true” android:icon=”@drawable/icon_about” android:label=”@string/app_name” android:theme=”@style/Theme.Javadoc” > <activity android:name=”.ui.DocTypeActivity” android:label=”@string/app_name” > <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> <meta-data android:name=”android.app.default_searchable” android:value=”.ui.SearchableJavadocActivity” /> </activity> <activity android:name=”com.google.ads.AdActivity” android:configChanges=”keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize” […]

onOffsetsChanged not called by Touchwiz

Note: since it is a question specific to Samsung, I also asked it on their developer board. I am currently implementing a Live Wallpaper in Android and I’m listening to the onOffsetsChanged() method in my wallpaper engine to change the wallpaper when the user swipes through his homescreens. This works great on my private Galaxy […]

Is there a way to generate the R.java file in Android Studio?

I have a saved Android project from long time ago and now I must to work on it. I’ve created a New Project in Android Studio and I’ve imported all the Java and XML files inside it but the R.java file is missing. I guess that it didn’t save the original. Can I recover it […]

Why my facebook android sdk login called two times?

I am working with the Facebook SDK, the problem is the FormSubmit function has run two times. It is called by the getView function which is called by onCreateView and by the statusCallback, how to fix it? public class Home extends Fragment implements LoginListener { public View rootView; public ImageView HomeBg; public ImageView buttonLoginLogout; public […]

PopupWindow background sometimes gets transparent and purple

Here’s how I create a PopupWindow: private static PopupWindow createPopup(FragmentActivity activity, View view) { PopupWindow popup = new PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true); popup.setOutsideTouchable(true); popup.setFocusable(true); popup.setBackgroundDrawable(new ColorDrawable(Tools.getThemeReference(activity, R.attr.main_background_color))); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) popup.setElevation(Tools.convertDpToPixel(8, activity)); PopupWindowCompat.setOverlapAnchor(popup, true); return popup; } main_background_color is a solid color, white or black, depending on the theme. Sometimes following happens: How can […]

Java class, Arraylist with multiple types

i’m new to Android & Java and have a question regarding my server-app-communication. My server always returns a JSON output with “Code”, “Message” and “Data”. Like this: e.g: {“code”:200,”msg”:”success”,”data”:[{“track_id”:123},{“track_id”:124},{“track_id”:125}]} e.g: {“code”:200,”msg”:”success”,”data”:[{“type”:”car”,”length”:100},{“type”:”train”,”length”:500},{“type”:”foot”,”length”:3}]} I want to use a class like this to work with the data: public class ServerResponse { private int code; private String msg; private […]

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