I have created an application in Android for RabbitMQ using RabbitMQ-Android tutorial. It is working fine. Now I want to create two applications in Android and I want to make a communication between them using RabbitMQ.
I have not found any example nor tutorial regarding this issue.
It would be a great help, if you could provide a link with code.
Thanks for your reply. I have created my first application using this tutorial only. But this tutorial shows the connection between Android and .NET application through RabbitMQ. I don't have .NET application. So, I want to create one more application in Android, and I want to send message between these two applications using RabbitMQ.
Is it possible??
Please give me any suggestion on this topic.
Thanks
Simon Dixon has a good tutorial that should get you going: http://simonwdixon.wordpress.com/2011/06/03/getting-started-with-rabbitmq-on-android-part-1/
You can use a Python script below to send message to Android client application.
#!/usr/bin/env python
import pika
import time
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
i = 0
while True:
channel.basic_publish(exchange='logs',
routing_key='hello',
body='Hello World, ' + str(i))
print " [x] Sent 'Hello World!'" + str(i)
i += 1
time.sleep(1)
connection.close()
Related
I am new to react-native.I am trying to build a simple android application that reads all the messages from the inbox and display it in a listview. In android,i can read all the messages using URI.
How can i read all the messages in a similar way using react-native?
Thanks in advance
In React native,you want to read sms from android phone:
react-native-get-sms-android
This module that supports interaction with the Messaging API on Android
The package allows you to:
• get messages
• send messages
• delete messages
Refer this for this module integration:react-native-get-sms-android
Make sure that you need specific permissions to read SMS for android.
For checking permissions in android,use PermissionsAndroid API.It provides access to Android M's new permissions model.For more details check this docs
react-native-android-sms-listener
To listen for the new messages in your app use this library.This library allows you to listen for incoming SMS messages.
Refer this for this module integration:react-native-android-sms-listener
Remember that everything that you did in Android, you can still do it in react Native, writing a Native Module, and here is a well explained example of how to do that https://facebook.github.io/react-native/docs/native-modules-android
Or I saw that there is this external library https://github.com/briankabiro/react-native-get-sms-android, that you might try.
I have created an android sample project using AWS Mobile Hub with User Sign-In and Push Notifications services.
I've downloaded the project and opened it through Android Studio, in order to take the necessary files for push notifications from the sample project and to integrate it in my existing Android app.
I thought it would be simple, but then I found out this huge files branch:
It is difficult to understand what files I do need and what files I don't need. Could you please help me to figure out what do I need to import into my existing project in order to integrate Push Notifications in my app?
You should copy the contents of MySampleApp/app/src/main/java/com/amazonaws verbatim into your new project and Also parts of AndroidManifest.xml and build.gradle and Application.java.
For a complete instruction, I would recommend that you go through Mobile Hub Console > Project Name > Build > Select Android > On Left side go to develop > Use as an Example.
You will find all the instructions you need for your android project
The "PushListenerService" class is basically a useful example class where the magic happens. So keep every file that support that class. The
private static void generateNotification(Context context, final String message)
is what displays the notification message.
Another important note is how to get the user's device endpoint value. This can be gotten using the "PushManager" class.
String endpoint = pushManager.getEndpointArn();
The endpoint ARN of a device help you send direct notification to that device.
PublishRequest publishRequest = new PublishRequest();
publishRequest.setMessage(message);
publishRequest.setSubject(subject);
publishRequest.withTargetArn(endpoint); //This can also be a "topic" ARN
snsClient.publish(publishRequest);
Pretty nice job done by the guys at AWS. Big thanks to them! :D
There is no easy way out. Just take your time and go through all the code in the classes that relate to the AWS service you want to implement. Good luck!
Btw, make sure your app is not open on the test device when you send a notification to it or else you won't see a notification since your app is already running. I notice this is a default behaviour.
As the first step in creating a cloud based mobile app I chose to try out the Google Cloud trial period. So as per the instructions in https://console.developers.google.com/start/appengine?_ga=1.92011098.1535487967.1418404546, I installed the Google cloud SDK and Google App engine and tried out the following code snippet as mentioned in the instructions.
from bottle import Bottle
bottle = Bottle()
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
#bottle.route('/')
def hello():
"""Return a friendly HTTP greeting."""
return 'Hello World!'
# Define an handler for 404 errors.
#bottle.error(404)
def error_404(error):
"""Return a custom 404 error."""
return 'Sorry, nothing at this URL.'
As per instructions, I
Sign in to Google Cloud Platform using this command: gcloud auth login
Install the App Engine package for Python using this command: gcloud components update gae-python
Start a local server using this command: dev_appserver.py appengine-try-python-bottle
However, it generated the following logs (which I am not allowed to share here apparently because I haven't earned some points here) and localhost:8080 was blank. Can you please help me understand what am I missing here ?
After putting bottle.py in the root directory and deploying it to GAE, the following code should work (template, static_file etc. will be probably useful for further development of the app so I am leaving them):
from bottle import route,run,template, view, request,response
from bottle import static_file
from bottle import Bottle
from bottle import default_app
from bottle import url
#route('/login')
def getHandlerLogin():
return "<h1>Hello world</h1>"
app=default_app()
Using bottle with GAE is not at all difficult, but in the long run it might be easier to use webapp2.
Look here for an answer: https://github.com/GoogleCloudPlatform/appengine-bottle-skeleton
Those instructions worked perfectly for me.
Ok, for a starter, I think you shouldn't be using Bottle (or any other unsupported framework) on GAE. It's possible to use them, but it's not simple. It's what may be preventing your GAE app from starting. In all cases, we need more debug data!
Try using Webapp2. It was the first framework in python I ever used, but it was really simple to use (really, no more than Flask or Bottle). Here' the doc : https://cloud.google.com/appengine/docs/python/gettingstartedpython27/usingwebapp
If you really want to use Bottle, being a WSGI-compliant microframework, it's apparently not so hard to set it up on GAE. Maybe use this outdated tutorial to try and make it work. There's this github that might also help you bootstrap your project.
I would like to have a background service running all time that register the device using the Parse API and emits Push Notifications, while having the main app developed in Qt with QML/JS. My question is: Is this possible? How can I do it? Is there any code-like example or documentation?
This is because I would like to write my application using Qt (QML + JS) and use Parse on the server side with it's PHP SDK.
Thanks for any help!
this should help (commercial solution):
http://plugins.v-play.net/plugins/parse/
I got the source code of sipdroid following the link
http://code.google.com/p/sipdroid/source/checkout
using the command :: svn checkout http://sipdroid.googlecode.com/svn/trunk/ sipdroid-read-only
Sipdroid uses pbxes.org to tunnel voip calls. But I want to configure this and use different sipserver to make voip calls.
As a new comer in this field I need help and suggestion about how to change this server.
In org.sipdroid.sipua.ui.Settings.java, you can find this:
public static final String DEFAULT_SERVER = "pbxes.org";
Replace it with your name.
There is a search box on the page you linked to (search trunk).
http://www.google.com/codesearch#search&q=pbxes.org+package:http://sipdroid%5C.googlecode%5C.com
It seems that the server setting is in Settings.java.