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!
Related
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 4 years ago.
Improve this question
So im fairly new to Java, anyway i have a implemented a simple Java program on IntelliJ which runs in the IntelliJ terminal, it basically ask the user to input some details and then records them along with the current time.
I now want to style it out using HTML/CSS to convert it into a webpage, where the user would enter the details into input boxes etc.
Im not sure how to approach this, what would be my best shot?
Also the user input is also being stored in a variable at the moment, would i have to use a database instead for a webpage?
Thanks.
Well I would recommend you to read first about what is Model-View-Controller paradigm in web page architecture, then you can probably better reply to yourself in terms of what you need for your webpage in order to do what you want.
I will grasp some about the things that you need:
You will need a database to store your user input details along with with the current time. (MySQL for example)
After that you need to define which type of data you need to save, you will have to make models in java for parsing those details from java to the db and vice versa.
Then you will need to create some services (You can learn about repositories before services if you need, which you probably would) to support those connections with the database in which you will retrieve data from DB.
A way to control how those services to serve your webpage is having a controller for processing the HTTP requests.
Last but not least, the controller will "glue" your jsp views with the data from services to be shown in your browser.
There will be many other ways, at least this is the way I know. I use Spring framework for building the MVC.
You have to do full stack page with java backend and html & css for the front-end.
Do a webservice with spring boot this generate a restful API to communicate with your web page using HTTP methods ( Get, Post, Put and delete ) and use AngularJS for example to parse the webservice created.
check out this : example
Quite simply, you'll need a web server to spit out HTML. I mean, there's lots of ways you could do it, but far and away the most popular is a web server.
There are lots of options for you. As an Eclipse fanboy myself, I can't say specifically, but a cursory google search yields this Tomcat plugin which should allow you to run a web server via IntelliJ. There are probably dozens of other plugins for differnt web servers you could use.
What you put into that server is up to you - it could be a simple html document populated by parameters, a REST endpoint, a JSP, who knows what. That's beyond the scope of the question - the first step is getting your web server up and running and then deciding the framework to use.
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.
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
for my new project I need to write server-side application that will serve some of simple requests. I have no experience of writing server-side application, so I need some advice.
The problem is that I don't know how to start; I've spent couple of hours searching google for some guidelines, but I got nowhere.
I need to write application that will ran on the server (I've installed Ubuntu server in VirtualBox and used briged connection, so I can access it from my network) and will serve some requests:
connnect to server
authorize user (check user and his pass in db)
store some data in db on connection (for example IP address)
I am not sure which language would be best to use and what do I need to know to implement that app. This is my private project, which I came up with to learn something new; until now I have always written apps that ran locally (usually in Java/C/Python).
I've seen some tutorials on PHP and Django, but I am not sure if I am going in the right direction.
Thanks in advance for all help :)
I would prefer to you meteorjs look at www.meteor.com the reason why im prefering this to you is that i was in the same position as you one month ago and i,m amaized with meteorjs. Also have a look at derbyjs. This frameworks are built on top of node.js it allows you to write only javascript end to end.
Look at install.meteor.com you will find a quick install bash file.
At the end you can do this with any of the languages you mentioned. Write with what you like the most.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have an app out in the market and planning to maintain basic user data somewhere on backend.
My app is free so I am NOT getting any money from users.
My question is what is the best way to store this data(data has name, email, phonenumber etc.)
One option is to use Google Mobile Backend starter kit but that seems too complex for such a small requirement.
Appreciate your help.
Thanks.
Ok, there are many options you can achieve your goal and these options depends on your proficiency in other areas apart from java and your preferences. Below is just a small list,
Server side language: php, jsp, etc
Database: MySQL, NoSQL, SQLite, etc
Webhost: any free provider (just google "Free webhosting service")
Client side: as you mentioned you already have an app on play store so you will have to update you application accordingly and release new version.
I prefer to use combination of php and MySQL for all my back end work as I feel it is very easy to create and maintain. I also use 000webhost.com as free webhosting service, this service is completely free and also supports php and MySql without any restriction.
First Step I would suggest you is to choose your web-hosting provider, sign up on it and setup your database through PHPMyAdmin (Very easy to do so if you know basic database fundamentals).
Second step would be to create an API according to your choice of server side language (I am assuming you would use php but you are free to use any other language). If you don't know any server side language then you might want to follow some online tutorial and get your self familiar with php (which is again very easy of you know some other programming language). You can simply start from coding basic functions such as retrieving all data and echo them on browser or insert some fields in database, etc. I would advice you to completely code and test all your functionality on normal web browser before you go on about updating you android application and the reason is that once you know what response you are expecting and you have tested it on computer screen it becomes easy to code it for android.
And the final step would be to update your android application, for this well know process is using json strings for sending and/or retrieving data to/from database. If you are only looking to insert few fields in database then you can also use GET or POST methods to send and receive data. And the good news is there are many great tutorials available online for HttpRequest from android you can google it yourself.
Disclaimer: I am not promoting any free/paid service provider in my answer, the only reason I mentioned name is because OP has asked twice for it. If you are thinking of downvoting or flagging the answer for that reason please leave comment and I would delete it ASAP.
I would use a simple php page that captures user data via json from Android and saves them in a MySQL db (technology simple and very cheap, there are many hosting php + mysql free or very low cost);
but if you prefer a java-oriented approach, although slightly more complex
I advise you to Google App Engine that is free (with well-defined limits):
http://www.vogella.com/tutorials/GoogleAppEngineJava/article.html
using the latter you will need to use servlets (do not recommend endpoints) and use JPA to access the database which provides GAE (NoSQL database)
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 1 year ago.
Improve this question
I've got the login name of my computer using System.getProperty("user.name"). However, I need the logins of other computers whose IPs I've already got using InetAddress. How do I do it? Displaying the System. properties of all the IPs doesn't display their login names.
Thanks in advance!
All the PCs run on Linux.And I'm looking for the currently logged in user on other machines on the LAN.
I'm pinging all the machines on my LAN to see if a machine is alive. I get it's IP and I want to get its login name as well.
If you were able to do this "out of the box", this would be a huge security hole in the system. Just think about it. And then we don't even get to the problem of multiple users logged in on the machines.
So without further clarification this question is just too vague.
You can actually log on to the machines in a secure way using ssh, for example, and query the list of logged in users. You need to generate ssh keypairs and use some Java terminal library that can do the login programmatically and issue commands for you.
We actually have a product that works like this (for different purposes), and we use a 3rd party SSH library to do the hard work for us.
Or, as an alternative, you can implement and install your own "logged-in-users" daemon that you can connect to, perhaps install it as a web application, but then again, you need to use proper authentication to make your service safe to use. This latter solution however requires that an application or at least a web server is running on each machine that you want to query.
The best possible solution would be to install a software that will listen to a fixed port on the machine. Once you have the machine's address, the program can gather the information and send it back. Other than that, there's no such feature that exists, for various and obvious reasons.
However, even this solution does not guarantee that there will be a listening socket on the listed IP (the software is not guaranteed to be running), so without more information about what exactly you are trying to do, this answer is as vague as the question.