I build one Android Call app and using Pushy API to receive Notification for the Call...
It works good, but sometimes the delay is over 5 minutes if the App running in Background!
If the app is not running in Background, the delay for Call-Notification is always high...
What I'm doing wrong?
Also, do you know another API like Pushy which would do a better JOB?
What piece of Code do you need from me to research for this purpose
Here is my Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.my.androidapp">
<!-- Pushy Permissions -->
<meta-data android:name="com.my.androidapp.ui.login.PushReceiver.default_notification_icon"
android:resource="#mipmap/ic_notify" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_SERVICE"/>
<!-- End Pushy Permissions -->
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_logo"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_logo"
android:supportsRtl="true"
android:theme="#style/Theme.ExpressSample">
<activity
android:name=".ui.login.AudioActivity"
android:exported="false" />
<activity
android:name=".ui.login.LoginActivity"
android:exported="true"
android:label="#string/title_activity_login"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.login.VideoActivity"
android:exported="false"
android:screenOrientation="portrait"></activity>
<activity
android:name="com.my.androidapp.ui.login.Main"
android:launchMode="singleTask"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:label="#string/app_name"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Pushy Declarations -->
<!-- Pushy Notification Receiver -->
<!-- Incoming push notifications will invoke the following BroadcastReceiver -->
<receiver android:enabled="true" android:name="com.my.androidapp.ui.login.PushReceiver" android:permission="android.permission.RECEIVE_BOOT_COMPLETED" android:exported="true">
<intent-filter>
<!-- Do not modify this -->
<action android:name="pushy.me" />
</intent-filter>
</receiver>
<!-- Pushy Update Receiver -->
<!-- Do not modify - internal BroadcastReceiver that restarts the listener service -->
<receiver android:name="me.pushy.sdk.receivers.PushyUpdateReceiver" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<!-- Pushy Boot Receiver -->
<!-- Do not modify - internal BroadcastReceiver that restarts the listener service -->
<receiver android:name="me.pushy.sdk.receivers.PushyBootReceiver" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<!-- Pushy Socket Service -->
<!-- Do not modify - internal service -->
<service android:name="me.pushy.sdk.services.PushySocketService" android:stopWithTask="false" />
<!-- Pushy Job Service (added in Pushy SDK 1.0.35) -->
<!-- Do not modify - internal service -->
<service android:name="me.pushy.sdk.services.PushyJobService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:stopWithTask="false" />
<!-- Pushy Firebase Service -->
<service
android:name="me.pushy.sdk.services.PushyFirebaseService"
android:exported="false"
android:stopWithTask="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
I'm on Google clouding message app that works on 4+ android devices. but the GCMIntentService
service wont run on my sony xperia arc that have android 2.3 and so it will not register to GCM. I also should say that my xperia arc is rooted. is rooting the problem? my project is customization of this link
I creates check points in GCMIntentService but it wont run at all.
this is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackagename" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<permission
android:name=".permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name=".permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<uses-permission android:name="com.mypackagename.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Network State Permissions to detect Internet status -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- mahdi comments: for registration of reciver for GCM -->
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".global.G">
<activity
android:name=".ui.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.mypackagename" />
</intent-filter>
</receiver>
<service android:enabled="true" android:name="com.mypackagename.GCMIntentService" />
</application>
</manifest>
Can anyone suggest me why this app is not visible for tablets on google play store.
I am using GCM, Gmap, Camera and storing files on sdcard.
It is not visible for major tablets on google play store, sim and simless.
I do know that google play store mask app from device which not match with manifest permissions however I believe that there no any permission which is not exist on major samsung devices.
Please find below manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app"
android:versionCode="15"
android:versionName="2.4.3" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true" />
<!-- GOOGLE CLOUD MESSAGING SECION -->
<permission
android:name="com.example.app.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.app.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- END GOOGLE CLOUD MESSAGING SECION -->
<permission android:name="com.example.app.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.example.app.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:allowBackup="false"
android:allowClearUserData="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/AppTheme" >
<!-- GOOGLE CLOUD MESSAGING SECION -->
<receiver
android:name="com.example.app.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.app" />
</intent-filter>
</receiver>
<service
android:name="com.example.app.GCMRegistrationService"
android:enabled="true"
android:exported="false" />
<!-- END GOOGLE CLOUD MESSAGING SECTION -->
<activity
android:name=".SplashActivity"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
If the Tablet android version below
android:minSdkVersion="11"
Then Google playstore .will not show app in the tablet
I have started working on GCM Notification
after a lot of goggling i checked out code through which i can get registration id from GCM Server so i used
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId= GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, "338056690461");
}
else{
Log.v(TAG, "Already registered");
}
But When i run My Application i get error on `CheckMAnifest()`
this means i have error in my manifest but accordint to me my manifest is correct please have alook to my Exception as well as manifest
Exception it gives
java.lang.IllegalStateException: Application does not define permission PushNotification.Pop.permission.C2D_MESSAGE
and manifest i have used is
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PushNotification.Pop"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<permission
android:name="PushNotification.Pop.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="PushNotification.Pop.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:debuggable="true" android:label="#string/app_name" >
<activity
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="PushNotification.Pop" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>
Please suggest me where i am going wrong your help would be greatfull
Thanks in advance :)
try to copy and paste this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PushNotification.Pop"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="17"/>
<!-- GCM connects to Internet Services. -->
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="PushNotification.Pop.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="indieswebs.magento.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<application android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity android:name="PushNotification.Pop.MainActivity"
android:label="#string/app_name_title"
android:clearTaskOnLaunch="true"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="PushNotification.Pop" />
</intent-filter>
</receiver>
<service android:name="PushNotification.Pop.GCMIntentService" />
</application>
</manifest>
or
I got answer for this issue. Just delete "gen"folder . It build automatically. Application will work fine.
I am new to android, i am having issue in implementing push notification.
As stated in a tutorial I read, i registered in c2dm and got Auth token, then registered in UrbanAirShip, with package xxxx, got app key and secret.
My project team used API 2.1 initially, at that time i got AppId through helium transport, both in device and in emulator.
Then we changed API into 2.2, at that time i again registered in c2dm with another sender id, got Auth token, and also again registered in UrbanAirShip with new account,
got key and secret.
For first few tries through c2dm transport, i got AppId, then i got only null, both in device and in emulator with errors as showed below,
I don't know what gone wrong, whether change in API level, or multiple sender id registration in c2dm, or multiple registration in UrbanAirShip for same package name or So many uninstalls.
I have added Manifest file and Application's oncreate method , please guide me to get back AppId.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxxx"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
<uses-permission android:name="com.android.vending.BILLING" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- REQUIRED for C2DM -->
<!-- Only this application can receive the messages and registration result -->
<permission android:name="xxxx" android:protectionLevel="signature" />
<uses-permission android:name="xxxx.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="10" />
<application
android:icon="#drawable/logo"
android:label="#string/app_name"
android:name="xx"
android:debuggable="true"
android:allowClearUserData="true"
android:enabled="true" >
<activity
android:label="#string/app_name"
android:name=".activities.SplashActivity"
android:screenOrientation="portrait" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
....
<!-- REQUIRED -->
<receiver android:name="com.urbanairship.CoreReceiver">
<!-- REQUIRED IntentFilter - For Helium and Hybrid -->
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
</intent-filter>
</receiver>
<!-- REQUIRED for C2DM and Hybrid -->
<receiver android:name="com.urbanairship.push.c2dm.C2DMPushReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="xxxx" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="xxxx" />
</intent-filter>
</receiver>
<!-- REQUIRED -->
<!-- The 'android:process' parameter is optional. Set it to a value starting
with a colon (:) to make it run in a separate,
private process -->
<service android:name="com.urbanairship.push.PushService"
android:process=":com.urbanairship.push.process"/>
<!-- OPTIONAL, if you want to receive push, push opened and registration completed intents -->
<receiver android:name="xxx.push_notifications.IntentReceiver" />
<service android:name="xxx.inapp.BillingService" />
<receiver android:name="xxx.inapp.BillingReceiver" >
<intent-filter >
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
</application>
</manifest>
The problem arises when you run in an emulator. You need to run it in device (and Gmail account should be setup - Else you get an error). Also, it should be 2.2+. Push is only supported on 2.2+ devices. Change the minSDK version to 2.2 and try it in device. It will work.
You need to make sure you are using the "google api" version of the SDK you want, and also to have a valid google account which is market enabled. This is a requirement for c2dm.