How does an application communicate with a webpage/server [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I want for my java application which I have started to develop to 'communicate' with my webpage. However I have no experience with webpages and would like to know how things such as login using user/pass verification works. Any links to tutorials, where to start, and clarification would help me a lot! Thanks :)

Yes,You can use form at client side for send data to server side..
at at server side you can catch data by using getParameter method.

You can communicate via AJAX
You can store data in session.setAttribute('name', name) / session.getAttribute('name')
You can pass some data in GET-parameters (request.getParameter('userID'))

If you want to develop a simple web application with login functionality, you need to know following. You might want to start from
here
Java
Database (RDBMS or NOSQL)
HTTP Servers/ Request / Response
If you have already developed web app providing some service (such as REST services), you can develop a web client using jquery/backbone.js.

Related

Is it possible to execute functions in a hosted php file from android/java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have an amazon web services MySql database that I want to perform CRUD operations on from an android application. I think that the way to do this is through some HTTP protocol and get and post operations. However, I have access to PHP code that connects to the database and allows me to execute quires. This PHP code is hosted on an elastic beanstalk application. Someone else has used this same code to connect the database to IOS. I am just trying to figure out how it all works.
Is it possible to use the PHP that is hosted to act as an API for me?
--I cant post any links due to security concerns, sorry.--
If you can make a REST call to an HTTP endpoint from your Android device, then yes, the PHP can act as an API.
Consider using the AWS API Gateway as the piece of 'glue' that you are missing, though its not required.
I had some friends help me and what I seem to have on my hands is an API that uses no sort of authentication. It is not restful because no token is returned and it does not implement sessions either. From what I understand, each hosted PHP file can be access via respective HTTP request.
E.J. Brennan proposed adding an instance of AWS API Gateway that I believe to be the next step.

Connecting and fetching data from mysql using angularjs [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to angularjs , can anybody guide me in performing CRUD operations in MYSQL and display in html form using angularjs... to be more precise... I want to store information to customer details such has name,consumer number,contact,address and update the same whenever necessary using java..
Hello and welcome to SO,
I created this diagram in order to make you feel more comfortable with the subject.
As you may see I didn't mention any language: Client, Server nor Database, because the language itself has nothing to do with REST APIs.
Instructions - begginer:
(If you are using PHP, I'd recommend SlimFramework, which is the light, scale, easy to start with, PHP Framework).
1) Pick a server-side language.
2) Create a Database Resource.
3) Pick a Server Side Language.
4) Create 4 Scripts that each does one of each:
Create,Read,Update,Delete.
5) Connect endpoints with each of the scripts, URL -
GET,POST,DELETE,UPDATE.
6) Verify that you can access each of them from the web (authenticated
or not).
7) After you verified that endpoints are working, time to connect
Angular:
7a) First try to create buttons for each action, and link it with
$http.get, $http.post, $http.delete, $http.put actions.
7b) Once it's working you might wanna step up and use ng-resource or
restangular.
P.S: I didn't supply much code information since once you understand what I stated on top, you'd realize that writing code for that isn't really hard.
After you complete these ,
You might wanna start with: Server side and Client side authentication, Performance, Multiple resources and collections, CORS and preflighted requests, and so on.
Good Luck.

Android App with Online Database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
i'm creating an app wherein the database are uploaded online without website, the concept of the app is like Waze app. I dont know where to start im asking for ideas and help. do i need to create a web server?how?i will mark this correct for those who can answer thanks.
This is not a simple task because it relies on many parts doing its proper job... In order to do what you want to do you need basically 5 things:
1.- Server: which will feed live information to the app.(There is a ton of servers that can be used to get this part done. If you are used to, or willing to learn php, I suggest you to start researching XAMPP (it uses Apache server running php stuff) [https://www.apachefriends.org/es/index.html]).
2.- Database: Most likely the server will need to work with information stored in some place. databases are perfect for just that. XAMPP also comes with MySQL which happens to be the most popular open source database out there.
3.- Format :You need to determine how the information will be passed from the server to the mobile device. The most common ways are: JSON which is plain text, XML that also is plain text but formatted diferently. this is important because you have to send the information from the server using this format and also your mobile devices will need to interpret the information in this format.
4.- Choose a way to send and recive the information : i would suggest Http/Ip protocol for this, as it is very common. Investigate Http requests and responses.
5.- Your device must be listening (or asking) for the content : the device will have to implement some sort of timer to ask the server for new information. This is determined by the logic and prupose of what you wish to do.
do i need to create a web server?
Yes! You need to create a web server, then, a webservice (database query etc...) which communicate between your application and your webserver. I think that all!

Sending new data from Java program to web browsers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to code a java program which must be able to communicate with web browsers (the clients). Sending data / answering requests is not a problem but I also want to send new data to the clients (so that they see it in their browsers without reloading the page).
What ways are there to accomplish that?
Is there any way to listen for new data (with JavaScript)?
i think what you are talking about is server push.
ie server will send data to client without polling from client.
There are various ways to do this one of the best way is through websockets.
you can use many java server available for websockets and have connect client for asynchronous push. while at client normal javascript will be able to receive the message.
What you're trying to do is called Reverse Ajax: Sending data from the server to a JavaScript-Enabled client (as opposed to a Regular Ajax, when the Client is the one that starts the communication). There 's a nice article on DeveloperWorks that can introduce you into the subject.
There are several ways to accomplish Reverse Ajax, and them imply some customization in both Client Side components (i.e JavaScript) and the Server Components (Java in your particular case). As WebServer says, WebSockets is one alternative -although is not supported by all browsers yet- but another viable solution is using Comet. If you're using Tomcat, this link might help you.

Call another java program when an android app makes a request [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In my android project, whenever a user asks to see a specific #hashtag, i want to check if any tweet had changed in twitter database about this hashtag and update my database according to that changes. The problem here is, i need to run another java project in my server to get updates from twitter and change my database. But, i don't know how to call another java program when a request made from an android app.
I don't know where to start or which path i should follow. I would be appreciated if anyone show me some way.Thanks..
Hi hello_stackoverflow,
visit this page: https://dev.twitter.com/docs/api and have a look at the twitter webservice api, especially this https://dev.twitter.com/docs/api/1.1/get/search/tweets, this would provide you with the search option the API provides you. With this you can search for a custom query within tweets on twitter.
So you'll not need to call an external java application, just call the RESTful Webserive from twitter and send a query with user input hashtag.
Patrick

Categories

Resources