Hello Folks I am new to webservice I googled a lot I couldn't come to conclusion so I am seeking help here.
I am developing simple Android app for education purpose I know Java programming.
Please any one give me the steps to adopt in development to consume API signature from the webservice backend. If possible Local setup steps. I am using FrontEnd: Android widgets with http. I need backend setup information JAVA restful + MySql + Application server ?
Advance thanks
I personally run a server from home on a Raspberry Pi for my pet projects. It uses a LAMP setup, which stands for Linux+Apache+MySQL+PHP. Linux is the OS it runs on, Apache is the main webserver, and PHP is for dynamic webpage creation. I would recommend using something similar; packages like WAMP (replacing Linux with Windows) bundle all four of these services together for easy installation and setup. I believe there are also a number of free MySQL server hosts which you could use, if you don't want to deal with port-fowarding/handling traffic.
Related
Currently I'm learning to build a REST API (backend) with the ionic application (frontend), but I'm facing an issue in backend REST API deployment. Thus, I'm asking this question to get some clues and answers related to REST API deployment, since I'm really new and no clue how to deploy a REST API. I had checkout some tutorial on youtube, but it seem like most of the example in videos are not using the technologies or environment that same as the REST API I built. The following shown the technologies I used to built my system frontend and backend:
REST API (BACKEND):
Language: Java, Spring MVC Framework
Database: Hibernate, Oracle SQL Developer
Web App Build Technology: Gradle, Gretty (To app start my application)
Ionic Application (FRONTEND):
Technologies: Angular Framework, HTML, CSS
How the application is working in localhost?
STEP 1: I will app start using Gretty plugin in gradle
STEP 2: I active the command "ng serve" (ionic serve) to run my ionic application
STEP 3: After both frontend and backend is successfully run, now I can access the provided link that generated from ng serve to access my web app and do anything I want.
Everything is working perfectly in local system, but it is different case when I test my ionic web app through my smartphone (Since ionic allows us to build progressive web app). The frontend ionic application will not able to communicate with backend when the operating environment of frontend is not in local system and I know it's really make sense, since my backend REST API haven't deploy which only able to operating on localhost. Therefore, I'm have tried to find solution on youtube and other internet sources to deploy my rest api online, but I don't see any information or deployment video that using the same technologies as I used to built my rest api (Spring MVC, oracle developer, gradle).
Thus, I'm asking this "stupid" question in here to find out whether any solution to deploy my rest api? or any suggestion to change the technologies that I used to built my rest api? or any mistakes I had made which violate the best coding practice in building rest api.
As a new programmer, I really appreciate the answers from all you guys. Thank you.
First, let's explain some concepts:
You backend is the application you coded, deployed on a server that exposes an endpoint for access - e.g. http://localhost:8080/yourApp - where your host/domain is your current computer (localhost) and the port is 8080 or anything you setup.
If you want to access from you smartphone:
1) Since your app is hosted on your pc, you need to be connected to the same wifi network
2) From your host machine, where you deployed your app, look for your ip address.
open your console/terminal
type ipconfig/ifconfig
look for your wifi and copy ipv4 address
3) redeploy your frontend pointing to your host machine ip
It worked before because you where on the same machine (localhost means redirect to your own device). When you switched to your phone it, also, redirects to your own smartphone.
I'm going to start developing a new simple "X management" kind app, like contact management or events management. What I want to know is which tools would be the best to achieve it in the way I want.
My app needs to be a web app running on a server that has a mysql database to save and retrieve some simple information. This app must have a web client but I want it to be able to be extended to work with an Android app client.
Things I've thought:
I've worked on Java with facelets and JPA travels management app running on a GlassFish server on localhost with a JSF web view, so maybe my web client and the full app could be done with this.
I've worked with web services such as SOAP and REST with Jaxb and xml schemes to retrieve information parsing some webs into xml or json to show on a client .net app. So I've thought I can add to my app, like last topic we talked about, a REST web service layer to easily work as I want, or at least I think it would be easy. If I do this the Android app could share the same app core code but using the REST service.
My question is what could be the best way to do an app with 2 client side in different platforms that could share some code to be easy to extend it moreover to a desktop app. I've talked about these 2 options because I'm a students of computers at university and those are the tools I know, but I can easy learn more. I've also think about just a REST service and create a web and an Android client to work on same service or something like that.
This post is getting long, so here is the summary: What technologies and tools do you think are the best choice to create an java web app that needs to have web and Android client? Also what server, like tomcat, GlassFish or another, should I use? And what about persistence layer? JPA with mysql is the best I know to work with.
Thanks a lot.
P.D: I work with eclipse
From my point of view:
You can use java jersey and java spring both ( java spring as Dependency injection) for creating RESTful Web service. So, In server side you will create endpoint and you can access data from any platform through those endpoint.
Server can be anyone. It's up to you. I always try to use tomcat but tomcat is not a full JavaEE container it's only a servlet container. So if you want to use full JavaEE version then you should use Glassfish.
And yes JPA .It can be easily used in any environment supporting JPA including Java SE applications, Java EE application servers, Enterprise OSGi containers etc.
On the other hand, still choice is yours.
I am really new to web apps and web services... But i have created a webservice and it's working in localhost(apache glassfish) but i need to deploy this thing in an external se(in java)rver so that every one can consume that web service via my app..Unfortunately am unaware of this technique.
so can anybody help in this problem ? Can i host this webprogram in normal godaddy webserver or is there any other way for this..in fact, my app is a small one and i need the solution for small apps or startups
thank you
GlassFish hosting will be hard to find. If your application is not GlassFish specific and can be run on JBoss, then you might try RedHat OpenShift. They have free plan for small application load and you get for free server administration, database administration, deployment is easy, you might concentrate on coding only.
Another option is to use Heroku. You will also need to neglect GlassFish, but they have easy path to creation of REST web service backend.
I recommend renting a server at amazon:
http://aws.amazon.com/ec2/pricing/
You can take already existing images with GlassFish and a Database or take a naked CentOs/ Red Hat Image and install your GlassFish manually. The link provides a table with all prices. A m3.medium costs $0.070 per Hour. It's super fast and flexible and you have high availability.
In NetBeans you can deploy on a remote server via: Services -> Servers -> Add Server:
Just enter your ip, username and password for the GlassFish Server:
Or
You can host your Project on a Raspberry Pi. Maybe the power is enough for a small Web App:
http://www.thehecklers.org/2013/10/27/glassfish4-raspberrypi/
Advantage: It's cheap and you can learn and control a lot.
I have just finished developing a REST web service that is consumed by a mobile application. The web service is developed with Java and runs on an Apache server.
I'm now moving to the testing part. And for that purpose, I need to host my web service in a real server.
It is a first experience for, and I just knew that using mutualised (shared) hosting does not allow me to host whatever application, in whatever language.
The one I get to use is OVH, which does not support java web services hosting.
Does anybody have any other alternative to provide. It would help a lot!!
Like I said, if it is for testing purposes you could always use a "normal" PC, running something like XAMPP.
As an alternative you could give RedHat's OpenShift a try, which offers a free, getting-started plan (more info here) that should more than cover your testing requirements.
To run your app (in Eclipse) you would need to : Run As -> Run on Server
And then select a server. If you haven't done so; I suggest you install a local JBoss/WildFly server (the wizard can take care of that for you).
Doing this will display options to run your app either on the local or the OpenShift/rhcloud server.This makes testing faster and allow you to avoid testing on the OpenShift live server.
I am beginner java web developer, now my question is after i developed my application, how to make users see it on the web?
I used JSF,MySQL and GlassFish server in my development stage and now i want to publish it.
I got a domain name and an a web hosting account on goDaddy.com
In other words what to do after i develope my web application?
what steps should i take in server creation and other stuff?
I have searched alot but there is no specific way for it. I am trying to make this dynamic website based on jsf development--and it is already done--become alive and out their like any other web site?
any guide lines and steps should i take in making this steps ?
Either you will need a "Production" server to host the application yourself or use a hosting service of some kind that provides a Java EE container. If you're tied to Glassfish, you can Google for those providers like http://glassfishhosting.com/.
Other options that might be good fits for you are cloud services. Something like either Rackspace or Amazon EC2. Each has their own pricing tiers that scale based on usage. Good luck to you going Live!
Can host the code on Github and push it to Heroku.
http://devcenter.heroku.com/categories/java
I don't know the provider you chose but you need a java application server for your live environment. And optimally this should be the same server as your development server.
For our projects we buy a virtual server and install Glassfish on it. This costs around 15 € per month and we have the same environment for development and production.