What tool to send push notification to android phone? - android

I need to test the C2DM service. I have already implemented the service in my Android app. Before starting coding the third party server which gonna send the notifications i would like to test my app.
Is there any tool working on Windows (preferably with an UI) which allow me to enter the registration_id of my phone , the account used into C2DM and a message.
I'm looking for a jar or an exe , don't bother to propose php or any web server based script , i can't install any server or interpreter on the computer which have access to internet :'( .
Thanks

C2DM is now depricated.
Use Android GCM http://developer.android.com/guide/google/gcm/gs.html

Finally build my own command line tool based on this article . Probably faster than keep searching a ready to use tool.

I got this to work to run as the server in VB http://www.androidsnippets.com/vbnet-server-side-code-to-send-c2dm-messages
Seems to work nicely, hopefully that's the direction you were talking about.

Related

Sending Requests to Locally-hosted OpenSips Server using android

I am really new to opensips and lately I was able to install the OpenSip server on my VirtualBox based VM ( Debian 10). Now I want to create an android application which enables SIP calling (Push to talk app) using that locally hosted OpenSip server.
I tried to understand the documentation on the OpenSips, but it is really tough for me. For now, to make sure that my OpenSip server is finely running and handling the SIP calls, can you suggest me a way to test it using an android programme?
Thank you!
Try Linphone - it's an Android based SIP User Agent.

NodeJS on IOS/Android

Maybe what I'm about to ask is stupid, generally I don't have so experience with server-side.
I'm building an Angular web application, with nodeJS on the server-side.
I need that the server (Node.exe) will installed in the device itself (IOS/Android), and nodeJS will open a localhost socket to communicate with the device.
(According to nodeJS official web site, nodeJS only support windows/Mac OS/Linux)
It's possible to do that?
If not, there is another server can I install in the device?
Yes you can with JXCore (a fork of nodejs), more info in this link
Build Mobile Apps with JavaScript and the Node.js Ecosystem repository is in here.
And how to compile it is in here JXCore - How to Compile
But if you need it to be nodejs (not the last version) you can use this link to do what you need Building and running Node.js for Android
UPDATED 27-09-2018
Like someone has pointed out, that project is no longer maintained but I have found and alternative by Using Termux on an Android phone you can use nodejs / gcc / vim / etc and more tools to do many thing
This link show how to do it for nodejs ( and I have tested it on my phone ):
Building a Node.js application on Android - Part 1: Termux, Vim and Node.js
First install termux from playstore, of course.
I don't understand the point of using a server tool on the client side.
If your application should work with an offline mode, you should put all data and other in your client app (using cordova).
If your application works with an online mode the server side is needed to serve your data. Here you can setup a nodeJS API which provides routes for your application to have content to print.
I'm not sure I brought you the wanted answer, so can explain more the point of using a server tool on a client device?
What you are trying to achieve, turns your device into a server.
A server side language is meant to stay on the server.
I don't really see why you need to open a localhost socket on the device to communicate with itself. Is it for offline testing? You can do that since you have a computer and a device, and both are connected to the same network.
I believe a really good start would be understanding the concept of the Client-Server architecture first.
But in short, the proper way of implementing a Client-Server app using your chosen technologies would be:
A server should provide the client with answers to his requests.
So in Node.js (server-side), write whatever you want to communicate with your database (Create, Read, Update, Delete), do custom processing, etc...
and return a structured answer.
The client is expecting answers to his requests, and is supposed to handle the answers in code. So the program written in AngularJS (which is your client-side language) will be installed on devices.
The client has to know the format of the server's answer. Is it plain text? XML? JSON? ...
so you mean you would like to have an app can run some services via http?
not sure if iOS allows application with JS virtual machine executing code ...
and for Android
searching on Github and I find how to build NodeJS for Android
https://github.com/dna2github/dna2oslab/tree/master/android/build
Here is an example to run compiled Nginx binary on Android at https://github.com/dna2github/dna2mtgol/tree/master/fileShare
You may modify a little more to replace Nginx to NodeJS. The code to run Nginx is not very nice; maybe you can try an Android Service to let the server run on backend on Android device.
Hope it is what you want.

Understanding aspects of Google Cloud Messaging - basic setup

I have an android application that is designed to receive push notifications via GCM. When I initially designed the application, I used a "deprecated" tutorial (merely because it was one of the most in-depth I found) and my dev phone was running API 2.4, so I was able to get the service up and running without much issue.
Now, my development device is running Android version 4.4.2, so my goal is to "upgrade" my application to handle GCM properly for all devices (for now, lets ignore the fact that I'll have to differentiate how to handle Push Notifications depending on API level).
I attempted to follow the Android Developer tutorial for creating a demo client app for Google Cloud messaging, which can be found here. https://developer.android.com/google/gcm/client.html
While I hate to sound like I want to ignore to smart coding practices, this official walk through was a little big in terms of scope (My application supports Phonegap, and while I think implementing native GCM is much easier than using the PushPlugin for Phonegap, I don't want to handle more than is absolutely necessary in my Java code)
As a last ditch effort, I simply downloaded the demo gcm code from the source they provided here: https://code.google.com/p/gcm/source/browse/samples/?r=1ca8e646c517310e2d46a6a6eda74106b8084fc5
I attempted to import the gcm-demo-client application, and although I know my SENDER_ID, I don't understand anything about the SERVER_URL. The documentation provided by Android Developers talks very generally about HTTP vs. CCS, and I'm struggling to grasp where this server fits into the grand scheme of all that is Google Cloud Messaging.
Assuming I download the gcm-demo-server project directory they included (which seems to be some kind of Java Project), how do I host it? My previous deprecated GCM simply used a basic android application in which I would submit a form containing the device Registration Id, and a message with a title and context. Unfortunately, I can't figure out how to import their demo-server into Eclipse (since Eclipse doesn't think it contains ANY project files), AND I cannot seem to understand how this server connects with my application in any capacity.
TL/DR Summary of questions:
1.) How can I go about "hosting" the gcm-demo-server from URL #2 above?
2.) If I can just copy the Registration Id from my client app to the clipboard, can I just use my "android server" application to send my messages?
3.) Maybe it's just me, but I don't see anything resembling a Receiver class in the gcm-demo-client project directory, only a GcmIntentService. How can there be an intent when the application can't even properly handle messages?!
Thank you for your patience and help!
(P.S. - I cannot provide any code- however since the code in question is merely the provided Android Developer GCM demo code, this hopefully won't be a big issue)
1) There are many companies that offer server hosting services. You should choose one.
2) If you copy the registration Id manually, and hard code it in an application that serves as a "server", you don't need to host a real server, though that would only work in development. In production, assuming you'll have multiple users who install you app, you'll need a real server that receives and stores the registration IDs of all of them.
3) The demo client project you are referring to is old, and relies on a deprecated library (gcm.jar) which contains a default implementation of the BroadcastReceiver, which receives the messages from GCM server and starts the intent service. If you refer to the current demo app, you'll find a BroadcastReceiver class.
The demo app might not work because it is a gradle project and you should preferably open it in Android Studio. That might be why it could not see it as an Android project at all.
I have recently started implementing GCM myself and it is not difficult at all. I am using AppEngine for holding the backend part of my app. In Android studio, there is a very quick and easy way to generate both the android client and the backend part including the cloud endpoints and even a web interface for sending the messages (you don't need to use it though).
I followed this tutorial https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints
Maybe this is not a fully satisfying answer for you, but I found the code very much readable and I understood how this stuff works.

Can we create an XMPP chat client code in windows just like in android?

I need my android phone and my PC (win-xp-sp3) to be able to communicate with each other.
I am successfully running a xmpp code in my android phone through SL4a/python and it can send and receive communication.Now the communication my phone is sending i want to receive on my pc through a code.(which at present i am receiving thorough my gtalk client)
My questions are: how do i go about it?, is there any pre existing code,script,link that i can refer to? or can i hijack anyway the msgs received by gtalk in my pc?
I tried to use the same android code to listen for the chat from PC by removing the android part of the code, but I was getting error on xmpp module not existing. so i copied the xmpp.py file from google developers website to my lib folder. but now if i try to run it i am getting error "No module named google.appengine.api".
So i did some homework and downloaded gdata-2.0.17.zip from google developers website.
My questions are: am I on the right path? what should i do next? Is there any document/link regrading the same that you know?
I know the question was long but i tried to be specific to what I am looking for.
Please help me.
Google App Engine is Google's cloud computing service. If you're not creating a web application using that, you need to find an XMPP module for Python which doesn't depend on Google App Engine.
https://stackoverflow.com/questions/1081634/which-is-the-most-mature-python-xmpp-library-for-a-gchat-client seems like it's relevant to this question.
There are a wide variety of XMPP client libraries available that will work on Windows in pretty much any language you want to use. Pick one and simply write an app that connects to the gtalk server. You don't need anything google specific to do that.

Remote wipe data using Device Administrator Application+ android

I am working on android device policies, i am able to implement wipe data, force lock using sample given at below link
http://developer.android.com/guide/topics/admin/device-admin.html. I am not able understand how to wipe, force lock, change pwd Remotly from server. I spent lot of time in searching to get information but i am not suceed. Please give any information to implement policies Remotely.
Thanks in advance.
I've googled around a bit today as well, and I've come up with the following solution:
First, write a device administrator app, like the one referenced in the link you provided.
Then you will have to implement some technique so that you can push messages from a server to the android client. As of Android 2.2, you can use C2DM (Cloud to device messaging) provided by Google, I guess it isn't to hard to configure and get going. If you do not want to use this, there is the option to use some other kind of messaging framework, that allows you to push data, like XMPP or MQTT. The facebook messenger app for iOS uses MQTT, so that can't be all bad. It will however require more work setting up, than C2DM for example.
Finally you will have to push some kind of message from your server to the client via the method you chose and let your device administrator app listen to these messages and respond with the correct action, depending on message. So you can decide on your own what the messages will look like and contain.
There is also the option of using Exchange, but I do not know how that works.
So that is basically what I found out from my little research, I'd love to hear other ideas from someone else as well.

Categories

Resources