stay connection always on web server by android divice - java

I want to stay connection on web server using php by android app.by java coding
suppose when get any new input from webserver (by url php) android app make a Toast with the input and run the app on background service how I do it.
thanks

simple way is use websocket ,
1. webserver should enable websocket , create a websocket endpoint
2. android app connect the websocket endpoint
3. webserver can push msg to app by endpoint
4. then android receive msg
you can reference these page:
https://github.com/codebutler/android-websockets
http://socketo.me/

Related

How to setup a FirebaseCloudMessaging server?

I did the android client side for FCM, I tested it using FCM console.
Now I need to setup a server which gets the registrationId from client using Http link and also sends push notifications. This is the first time I am setting up a server.

Integrate a finished web service in a Android application

I don't know if the correct term is "integrate" or "connect" a finished web service in a android application. I mean,
Is there any possibility to "integrate" a finished RESTful Web Service in a Android application, which I have not developed, yet.?
Otherwise,
Are there some steps to develop a RESTful web service which I need to use from a Android application?
The last question is asked because I don't know if the first step is to finish my RESTful Web Service and then integrate it in my android application or or developing the RESTful web service and the android application at the same time.
In any case, how I can do it well? I need help to organise my mind
You will need three things:
Client(your app)
Server
Database
Lets say you have to create a login service for your app. Then your steps should be like given below:
Create a login form with android UI.
Get username and password from Edit Texts in strings.
Send these credentials to server(via http reqest).
At client side read response from url via input stream.
At the server side, use a server side technology in which you are familiar with.(If you are not familiar with any server side tech. I strongly recommend you php.)
Select/update/compare (Whatever you want) in data base and return response as a json string.
You can use server on your system. I suggest to use XAMPP(cross platform apache mysql php perl). As its name says, it includes server+database+php (its local). It will create a local apache server on your machine.
Follow this : XAMPP Tutorial , Working with XAMPP
Here are some nice tutorials of web services with android:
How to connect Android with PHP, MySQL
Using Database from an Android Application

How to call a java REST web service from android phone

I have built the client using Android and the server using java REST web services.I am able to access the server while running the android code on emulator.However,when I install the .apk file on my mobile and try calling the
REST web service;it does not connect.No communication between the two is initiated.
Check if you are using your public IP address to connect to your server(from client) or not. The URL that you provide in your client should have public IP and not private one.
To determine public/private IPs, please go through the below link
http://www.howtogeek.com/117371/how-to-find-your-computers-private-public-ip-addresses/

program-o for android chat bot application

I am developing android chatbot application using program-o. I have program-o running on my localhost. I went through program-o documentation but still, I'm not able to understand what changes I need make to enable the communication between my Android app and program-o server.
Write a php code to use program-o api.
Take the chat input from GET/POST parameters.
Use that input to get the output from program-o.
Parse that into json or any other format you like and print it.
Host that php file on a web server.
Now make an HTTP connection from android app. Give the input as parameters and parse the output received.
You have to create a LAMP server and run an instance of Program o
Json / xml rest api will interface will android app
You must use async task runner,httpresponse , and all.

send sms from php using local phone-modem as sms-gateway

is there a way to send sms using local cellphone connected to pc,from php web applications ?
i understand that it can be done by external gatways but unforunatly my php project is offline based. so i was wondering if there is any way to do this wihtout need for internet connection.
i have googled a lot and found there is couple lib for java like serial-comm and smslib but is it possible using php ?
im using xampp on windows to host my web app on local network
Apache 2.4.3
MySQL 5.5.27
PHP 5.4.7
phpMyAdmin 3.5.2.2
FileZilla FTP Server 0.9.41
Tomcat 7.0.30 (with mod_proxy_ajp as connector)
Strawberry Perl 5.16.1.1 Portable
my project is based on php5-Codeigniter-doctrine orm-mysql-mysqlite
if it cannt be done using php, can i some how code a helper with other programming language (ror,java web,etc..) that would facilitate communication between connected sms gateway and web app with minimal messing with my network setup?
also can some one please explain the criteria of phone that can be used as an sms-gateway ?
Note: my clients sms traffic will not exceed 50 sms per day/per local-network/per modem ,
at most.
one of best resourse i found online about this topic is here http://www.developershome.com/sms/howToSendSMSFromPC.asp
you can send sms using php but you have to setup a sms gateway server. you can then post/get request to that url to send sms. now that sms gate way server should have a gsm modem or a mobile phone connected.
So requirements are
SMS Gateway with GMS Modem / Mobile Phone attached.
A url on the server upon whihc you can send request

Categories