Passing a WebView between activities? - Android Software Development

Hi,
I'm a bit of a noob at all this. I've been experimenting with a test app that involves using a WebView to access a service via a website. The site as it is normally browsed is not very mobile friendly, and has no mobile equivalent. It doesn't use a simple authentication system and there are no APIs or nice friendly XML web services from which I can pull data. The service requires users to login and input random letters from their password in order to authenticate, along with an SSL handshake, the web browsers session ID forms a part of the authentication process. It is impossible to get a user logged in and pull data without using a web browser basically.
The test app I have built uses an invisible webview, and when a page finishes loading it injects javascript that enables XPath in the WebView so that the app can pass user inputs and data from the app's UI to input boxes in the invisible webview. So basically, what I want to do is load a page, analyse the contents of the page, and build a mobile-friendly UI for the user to interact with, and present the data from this service nice and easily on the move. It would probably run like ass over a standard GPRS connection, but in areas with 3G and HSDPA - I think it could be useful.
Now to achieve this - I can either have *one* activity, and program a loop whereby when a page has loaded the app dynamically rebuilds the layout(s) in that activity (I'm not entirely sure I know how to do that).... OR I can try and save the webview state and pass the webview between activities. That would be much easier, because I could build activities ready-made for certain eventualities.... Is passing a webview between activities possible?

Related

Loosing authentication when navigating between 2 web pages

Hi,
I did develop a web application using asp-pages including JavaScript as a front end for an backend application. JavaScript is needed to interface with the back end application.
In order to get data in and out the backend I need to go via a .dll that is on the web server. Before I can do that I need to login via an authentication object. Authentication details are in the DB.
After successful authentication I can jump between different pages and can do whatever I want based on the permissions that I have as the user logged in.
That is the expected behaviour of the application and it works as described above using an ASUS MyPal.
I have troubles with my MDA (T-Mobile) as I am loosing the authentication when navigating away from the page that holds the authentication object.
Going away from that page, the browsers (PocketIE (after a registry hack) or NetFront) loose my authentication information and database content is not displayed.
Everything is working well on the MDA and contents is displayed correctly if I bypass/delete the authentication code. But then I have a security problem, of course. So the point is, that the information, that the user is authenticated, gets lost between 2 pages. According to T-Mobile the MDA does not fully support Java as they have licensing problems with Sun.
Can this be the problem?
Can anybody help? I am happy with every registry hack or similar. How can I force the MDA to keep the memory, as the ASUS MyPal does or any regular Windows Notebook/Desktop?
Any help is highly appreciated!
Thanks!
Joscha

Advice on the choice of querying a remote DB

Hello everyone,
I come to you for some advice about an application I'm developing for Android 1.6 and higher.
Specifically, this application must be able to query a remote MySQL database and display the retrieved data. It need also be able to UPDATE data on this databse and that is where things get complicated ...
For selection queries, I wrote a small PHP script on the remote server that retrieves the desired data in the database and encodes them in JSON. From my Android application, I have no problem to retrieve, process and display them.
Now I wonder about the solution (if there is one ...) to run UPDATE from my application on the remote database. For now, I see only two solutions:
- Develop a webService on the server with an update method. Several problems with that: it seems webServices on Android are not easy (not native, have to go through external libs). Moreover, as it's UPDATE query, I want to make sure nobody else can use this webService.
- Alternatively, write a PHP script that makes the UPDATE and call it via HTTP. Same problem as webService: I want to secure this call to be sure that only I can use this script. These scripts can be integrated into an application already present on my server and which is secured by login / password. So, if it is possible to manage PHP sessions from Android, it's won! but Ican't find anything about it ...
What do you think? Ideas?
Thx!

[Q] Impostor

Has any Android developer considered the possibility of converting the open source Impostor SSO Proxy to Android?
http ://impostor.sourceforge.net/
It's already written in Java, and I could see it as being incredibly useful. Many people encounter a need to logon to various websites from insecure locations but don't have a dedicated server to run a single sign on proxy from, however if they had their Android phone with them the ability to start up & proxy through an app on the phone in order to avoid entering any logon credentials would alleviate that.

[Q] My Routers Pro - for android?

Hi All,
I was wondering if anyone has seen an app similar to the ipdas "MyRoutersPro"
it was really nice for anyone that has to deal with network devices. Almost makes me want to buy an ipad.... mmm Nahhh.
Features of the app....
•SSH-2 and TELNET access to remote hosts or routers
•PING, TRACEROUTE and integrated BROWSER
•allows access to non-standard ports other... Read More than 22 and 23
•supports SSH authentication by passwords or public key
•allows import of public and private key pair
•stores router credentials with strong encryption
•one-touch login
•configurable to ask for password before login if user prefers
•master password to prohibit invalid access to the app and login data
•supports up to five concurrent login sessions
•provides three command sets which can be edited as normal text files by users (effectively supports unlimited number of macros)
•customized commands can be imported to the command sets by copy-and-paste from other apps, e.g. Mail
•well-designed user interface to minimize typing when accessing to routers' CLI
•logs can be saved for subsequent review or sent out through in-app mail function
•user-selectable font types (totally 6, 3 are monospaced), font sizes and themes
•supports portrait and landscape modes
•Ping and Traceroute are implemented (to run from the iPad) as supplementary tools for troubleshooting
•supports simultaneous pings to multiple targets
•supports reverse DNS lookup in Traceroute
•includes integrated browser for viewing manuals on the Cisco & Juniper web sites (also serves as a "private browser" for web surfing

Commerce Application

Hello,
Early apologies if this is an incorrect forum but it's what i found about app development. If so can someone link me to something relevant?
I am going to preface this post by saying I have been using OOP languages for a long time now yet all localized self contained programs usually in python. I've gotten fairly used to some of the android API and parsing XML data to java and the reverse however I'm completely ignorant when it comes to php parsing.
I'm working on an android project for a client. I want to do an commerce application. Starting off I have already established XML UI's for a logging in, new user, main menu, and product search page. My main concern at this point is getting the remote data. Please correct me if I'm wrong but this was my plan for data handling.
Three different PHP scripts on a remote go-daddy server to access a database that holds a user data table as well as a product data table structure is as you'd expect user:{first_name, last_name, password, ect....} product:{SKU, UPC, Name, ect...}.
One of these PHP scripts pulls data from the products table for the products activity. One compares log-in credentials for the log-in activity so people can find purchase history ect... and one inserts rows to the user table for the new user activity.
Again if this isn't optimal some advice would be helpful. If this setup works however I already have a written PHP script(again held on the remote server) that parses the data into JSON format. My next step would be to write the java for the products activity to run the script and parse the JSON back into a usable format. Is there a specific java library to do this? Any UML depictions or tutorial links would be appreciated,
Secondly a big concern would be the new user script specifically how do i pass data from the java activity into the php "Insert script" i've read some on GET and it seems to be applicable to html but not java also this would be stupid for password security. again any help on any of these matters would be appreciated.
Have a look at Google's Gson library. It's great.

Categories

Resources