Android Question How to Run "MQTT Android App" in Background

Adamdam

Active Member
Licensed User
Longtime User
Dear All:

I need to make my Android App work in background (i.e. mobile screen off, or I work with other program).
example: whatsapp give alert at any time when receiving new message.

in other word:
I need the app on this link :
- https://www.b4x.com/android/forum/t...-the-home-temperature-with-adafruit-io.80820/
or what in this link:
- https://www.b4x.com/android/forum/threads/b4x-mqtt-chat-room.61568/


give alert (notification message, ring,...) indicating the new temperature (say other threshold level) received.

Thanks in advance for all.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Where did you get this info?
Out of curiosity i decompiled whatsapp time ago.

Did it again just now to answer your question.

this is part of the Manifest from Whatsapp.
<receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver" android:enabled="true" android:exported="false"/>
<receiver android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" android:permission="android.permission.INSTALL_PACKAGES" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.measurement.AppMeasurementService" android:enabled="true" android:exported="false"/>
<service android:name="com.google.android.gms.measurement.AppMeasurementJobService" android:permission="android.permission.BIND_JOB_SERVICE" android:enabled="true" android:exported="false"/>
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:permission="com.google.android.c2dm.permission.SEND" android:exported="true">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.whatsapp"/>
</intent-filter>
</receiver>
<service android:name="com.google.firebase.iid.FirebaseInstanceIdService" android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<provider android:name="com.google.firebase.provider.FirebaseInitProvider" android:exported="false" android:authorities="com.whatsapp.firebaseinitprovider" android:initOrder="100"/>

This leads me to the info it is using Firebasemessaging :)
 
Upvote 0

Adamdam

Active Member
Licensed User
Longtime User
Thanks for all,

I try now to run with firebase like in the link:
- https://www.b4x.com/android/forum/t...s-firebase-cloud-messaging-fcm.67716/#content
- https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/

I follow all steps,
but i have error in compilation as:
"
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.00s)
Organizing libraries. Error
Maven artifact not found: com.google.firebase/firebase-crash
"


I try to go with steps in the following link to fix this error,
https://www.b4x.com/android/forum/t...-not-found-com-google-firebase.68893/#content
but fail to fix it,
Can you help me to run application with firebase like in the first link
 
Upvote 0
Top