I am new to amazon EC2 web server. My client has given the URL like this http://ec2-00-00-000-000.ap-southeast-1.compute.amazonaws.com:3000. I want to use this url for fetching data from server or sending data to the server.
For example i have a login module. I want to sent username and password through this url over internet. How can i do this? Anyone can provide me the code. It will be helpful for me
thanks in advance.
Related
I am trying to post data from my client android application to a django server.
for example I have User {login:---, email:---} and I wanna post them my LOCAL SERVER based on django.. what I should do ? any link or tutorial can be greatful, i can't find any thing really helpful.Thks
You need to make a HTTP request to your django server. Here is a similar question how to do a post request in android
I have 5,6 android app which uses same URL(hard coded in apps) to invoke HTTP requests, the problem is that if the URL is changed due some reasons i have to re upload all apps with new URL which is a problem for me and i am looking for a solution for this.
I can build a web service to check for valid URL at initialization or connect to a remote database to get new URL but problem is that they need static IP and in my case i don't have it.
Is there is any method to notify and send small amount of data without having static IP.
You can use a different way to include URL in your app, like a configuration file or some like this, and when you need to update the url you can do this with a simple GCM (Google Cloud Messaging) message with a payload, but you need to implement GCM requests handling in your app.
GCM permitt to send message without the need of a static IP
The best solution i found for this issue is to use MongoDB which free for <500mb i can easily update MongoDb and my app can retrive String from it.
I'm creating an android app that interacts with a MySql database through a PHP page.
So I need to do an authentication on the page and I used the .htaccess apache auth (you can see the login form here http://www.imaginsystems.it/uni/)
The problem is that I couldn't find anywhere the code to automate this login. Does someone have this code??
Thanks
So you're wanting to send the username & password with the request from your App to your PHP script?
I believe you can use this format for sending that kind of login information with the URL:
http://username:password#www.imaginsystems.it/uni/
I have 3 entities:
1.Android Phone
2.Local Server
3.Fb Server
I want user to login from his phone on to FB , but once authenticated , I want to be able to pull data into local server from FB(no data on to phone).
What is the best way to do this ?.
Is there a way to do this using oAuth ?
This is certainly no problem. Just implement the server-side authentication flow on your web server. Instead of placing a login button on a website where you redirect the user to the Facebook dialog, you open the browser on the smartphone (or embedd a Webview) with that URI. The redirect_uri then points to your web server callback, where you receive the authorization code. Then you exchange that code for an access token by calling Facebook from your server and you're done.
On the phone, point the browser to:
https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID
&redirect_uri=https://YOUR_SERVER/YOUR_CALLBACK
&scope=COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES
&state=SOME_ARBITRARY_BUT_UNIQUE_STRING
After handling the callback, issue a request from your server to:
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID
&redirect_uri=https://YOUR_SERVER/YOUR_CALLBACK
&client_secret=YOUR_APP_SECRET
&code=AUTHORIZATION_CODE_YOU_RECEIVED
I'm trying to make an application that needs authentication :- when user type username and pw in the text boxes it should check with the DB in the server and authenticate.
how can i do this in the android?
can please any one help me??
thank you,
If you are a web developer you can do this authentication very easily. You can follow the following steps,
First, get the username and password from the user and put in the variables.
Create the HTTP connection to the web server (Your data posting URL).
Post the data to the URL with specified data using HTTP Get or Post method(Post is preferable for authentication)
Get the posted value using server side script and do the authentication.
send the response status to the client by using JSON encoding or some other format whether the authentication is succeeded of failure.
Get the response in android and create the InputStream and decode the JSON or some specified encoding format which you done in the server side and shown the response in mobile.
Thats it.