In browser based web application(java), UI pages are served from web server . For example :- JSP are converted to HTML and then sent back to browser.
How does it work in Android Mobile Application ? Say i have a some mobile application whose home page has Employee Detail button. When i click on this button , I should be
navigated to new UI page(say Detail page) which should displays employee details.
Mine understanding :- On server side there will be restful API that will receive the http request and send the just Employee details in form of json. It will not send any UI
page. UI page(detail page) should already present inside mobile app. Now when i click the get detail button, i will be navigated to detail page . Now android API will fill
data i received from server in to that page. Is this correct ?
On server side there will be restful API that will receive the http request and send the just Employee details in form of json
It would not have to be JSON, though that is a typical response format for a Web service.
UI page(detail page) should already present inside mobile app
"Page" is not an appropriate noun here. Most GUIs do not use the term "page" for units of their user interface, as that is mostly used in Web apps. Desktop and mobile GUIs have other units of user interface: windows, screens, etc. In Android, the coarse unit of user interface is the Activity.
But, terminology aside, you are correct that normally a mobile app has code that will take the Web service response and use that to display results to the user, by one means or another.
Now when i click the get detail button, i will be navigated to detail page .
How navigation works is up to you and can take many forms.
This is no different than in a Web app. In a Web app, when the user clicks a button, the user might go to a different Web page, or might not. In the latter case, JavaScript code in the existing Web page might make a Web service call and update the contents of the current page.
The same thing is true for desktop and mobile programs.
Now android API will fill data i received from server in to that page
Some programmer's code will take data that the code received from the Web service and use that in the user interface, by one means or another.
Related
I have one application who has two parts one is display module which is web based using j2ee and other is my backend service module which is on java. I have one page which has 4 tabs which has graphs. When click on tab, it sends start request to my backend application to start sending live data on my page. Problem is when I change the page to other page, my backend service keeps on sending the data. I want some way from which I can send stop request to my service program, when I change the page or close the browser. Please provide me some idea.
I'm developing a Dynamic web Project in java, and the goal is upon click on button to fetch the "ITERATION BURNDOWN" graph from https://rally1.rallydev.com.
my question is do i have to know the rally api in order to get this content or just to go to the appropriate url and search there the graph?
i login successfully to the rally (used this link for the login: http://www.mkyong.com/java/how-to-automate-login-a-website-java-example/).
after i login successfully i couldn't get the url with the graph. it's just returning the landing page content.
pls help,
Thanks
I assume that you refer to IterationBurndown on Reports>Reports page, which is served by a legacy analytics engine.
To get the appropriate URL you may need to install IterationBurndown report wrapped in an app from AppCatalog on a custom page in Rally. I cannot confirm a java scenario, but the URL of that custom page can be used with javascript, by making an html file with this custom page embedded using iframe, for example:
iframe.src = "https://rally1.rallydev.com/#/12345d/custom/6789";
The steps are:
create a custom page
install IterationBurndown report from the AppCatalog as an app.
At least in the javascript app case, the URL to IterationBurndown on Reports page will not work for this purpose, hence the extra step of using a custom page.
When you say that you get a landing page, I am not sure if you are referring to login page or home page. If it is the former, it means authentication has not been handled. Legacy IterationBurndown report wrapped in an app will not work with newer ApiKey. That's too bad because ApiKey, unlike LoginKey, works with Java as well, unlike the legacy LoginKey which works in the browser (with html/javascript apps) only.
Suppose I have a website that I can log into (at any time) and submit data to every x hours (click a link visible once logged in), how would I go about automating this process?
I have built a gui that provides the user (for now me, for my own convenience) an interface with some information, lets the user type in the log-in info and a button for starting a scheduled and repeated task in a ScheduledExecutorService but I am stuck at that point. Currently I use the Desktop api and browse() and rely on the user having logged in and just browse the url of the clickable link.
Knowing the URL of the loginsite, how do I submit the login info from my application to the the loginform of the website and let the website process it? (and let my app know the login was sucessful) and then click the link that will be visibile at a different URL once the login succeeds?
Looks like you need Web Services. Try exploring WSDL or REST api.
EDIT : Looks like you are trying to use Selenium which is a functional test framework. Set it up like the program describes at the end of the getting started page. After that you should be able to access the html page elements as provided in the tutorial.
If the webapp doesn't expose some kind of web service you cannot automate login procedure or any other action on the site.
If the website is your project, than you can implement web methods that allow you to achieve what you need.
I'm working on a Java REST server serving an iPhone app. Now we have to integrate with third party service exposed by oauth2 protocol. This is new to me so I've been reading and writing some "proof of concept" code but I have a big problem or I fundamentally don't understand something...
I made a simple web page with "log in with XXX" button that the user sees in a web view. When he clicks it, login page of the third party service opens and he can approve my app, at what time they will redirect the user to an URL I've specified with the authorization code as a parameter. This URL points to a REST service on my server.
The problem is that this URL must be absolutely the same as the one I've set up when applying my app for their service. Since I'm running a REST server I have no way of knowing about which user are we talking about when the redirection to my server happens (there is no session). I wanted to do this identification with some query or path param but they are not allowing it.
Does any of this makes sense to you or am I implementing this in a wrong way? The only possible solution I can imagine now will be with the help of cookies but I'm not really fond of that...
Yes, that does make sense. You got a few different options, try one of these:
Store a cookie with some user id and read it out after redirection
Use the state parameter of the authorization request for transmitting some user id. The provider is required to return it back to you in his redirect.
Redirecting application link to Java - GWT Custom page.
Whenever user will login through my APP.
and user hit button(say add record) then redirection should happen i.e. page should redirected to GWT custom page from application link.
How to call servlet when application link hit by button?
after that How to call GWT page from called servlet.
Wants to show GWT custom page with data present in REQUEST.
Hidden fields available on UI Screen which is developed in GI .
These fields can be passed to GWT custom applications launched from the application link.
APP(UI) --> SERVLET---> GWT page(UI with data present in request i.e jsessionid,hidden fields)
what changes need to do in web.xml ?
Plz provide any helpful document,link,sample code and any idea
Hope for the best co-operation
Thanks in advance.
Do you already have a fixed login page (servlet) tah you must use? Then do this:
Window.Location.assign(loginUrl) will take you to a new page. Your GWT app will be "closed" and all state will be lost.
Your login servlet should redirect back to your GWT page when done. Usually this is done by supplying a URL parameter when invoking login page - check the login servlet. Usually something like http://yourserver.com/login?returnTo=GwtAppUrl.
At this point your user is logged in, which means that servlet has set a session cookie. From this point on (until logout or session time-out) your GWT and GWT-RPC will use this session automatically (browser sends session cookie) - you don't have to do anything.
You can pass some data back to GWT by fragment identifier http://yourserver.com/login?returnTo=GwtAppUrl#somePage/parameter1/parameter2. However better option is to just use GWT-RPC to get the data from server.
Otherwise, if you are making everything from scracth, you can use GWT do do the login: How to implement a login page in a GWT app?