What is the `Authorization` part of the http post request of Google's Firebase Downstream message?

I want to try to send a message using google’s FCM messaging service and as the document says, the http request should be something like this: https://fcm.googleapis.com/fcm/send Content-Type:application/json Authorization:key=AIzaSyZ-1u…0GBYzPu7Udno5aA { “data”: { “score”: “5×1”, “time”: “15:10” }, “to” : “bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1…” } My problem is that I have not idea what Authorization‘s value should be and […]

Android: Get the listview item from button clicked in custom listview

I have a custom ListView with two button and I when I click either button on any row I want to get the text label on the Listview and for now just popup a toast with it. So far nothing has worked I keep getting the last item in my array. Here is a screen […]

Build errors with new kotlin 1.1 , kapt cant parse databinding params

I updated my project from android studio 2.2 to android studio 2.3 and incremented the project from kotlin 1.06 to kotlin 1.1 This is the error I get :app:javaPreCompileDebug :app:transformClassesAndDataBindingWithDataBindingMergeArtifactsForDebug UP-TO-DATE :app:compileDebugKotlin w: The ‘-d’ option with a directory destination is ignored because ‘-module’ is specified :app:compileDebugJavaWithJavac Processor path was modified by kapt. Previous value […]

Create TextView from template XML file

I have a template of simple TextView in a file simple_txt.xml <?xml version=”1.0″ encoding=”utf-8″?> <TextView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”wrap_content” android:layout_height=”30dp” android:textSize=”18sp” > </TextView> In some code I need to create a TextView from this template, something like: TextView txt = new TextView(this); txt.setLayout(R.layout.simple_txt);//??? then do something with it (setText etc.). How can I create a TextView like […]

Android – How do I dynamically set the package name at build time for an Open-source project?

I’m working on an Open-source project. As it is intended that anyone can download the source and build it themselves, I do not want to hard-code the package name anywhere – including the directory structure. I use ant for building. Apparently I can modify build.xml, but I believe this is overwritten by android update. Whatever […]

How to store a Date object in SharedPreferences?

Is it possible to store a Date object using SharedPreferences? Actually in my code I have a String variable, boolean and Date. Here is my function for storing all the objects except Date. So how that can be done please suggest me? private void SavePreferences() { String key=”1″; String value=”hello”; int x=5; Date currentDate=new Date(); […]

Importing org.apache.commons into android applications

Hay, how do i import org.apache.commons packages into android so i can use them in my applications? Thanks

My cordova webview app is really slower than in the android browser on the same phone

I built an android app with ionicframework and cordova. But when i try to run on my Samsung Galaxy S4 the app is really slower than the same code in the webbrowsers of my phone. How can i expect to have the same perfs ? I’ve tried : android:hardwareAccelerated=”true” this.appView.getSettings().setRenderPriority(RenderPriority.HIGH); this.appView.getSettings().setPluginState(android.webkit.WebSettings.PluginState.ON_DEMAND); <uses-sdk android:minSdkVersion=”14″ android:targetSdkVersion=”19″ /> […]

Android Studio show the dialog “unable to create debug bridge : unable to start adb server: unable to obtain result of 'adb version'”

When I open the Android Studio, it’s show the dialog below, and my application can’t run as debug mode.

Android app – Adding a “share” button to share the app on social networks

I have an app, and I’d like to add a share button to it. Once the button is clicked, I’d like it to open the following window: Then the user will choose where to share it and it will display the following default message: “Just found this great app! Find it here:https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro” Can you please […]

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