J2ME web server, access localhost using IE - Windows Mobile Development and Hacking General

I am trying to make a program in j2me (using Esmertec JBed) that acts as a web server (that only serves the localhost) and calls a browser to connect to itself.
Sounds simple enough, but I can't get it to work.
I am using the web server code here:
http://javaswamy.blogspot.com/2003/09/j2me-turning-your-phone-into-web.html
and added
"platformRequest("http://localhost/");"
to the end of startApp()
There are 2 problems, though. The JVM cannot open the URL because apparently it cannot run opera while my code is running (it can't run 2 java programs at the same time?)
If I open IE and go to "localhost", I get "Action Canceled".
Anyone has experience with this?
If you are interested, I am trying to make an offline wikipedia reader. I don't want to lose all the formatting, and using the browser to render HTML sounds like the easy way to me (I can even implement links since it runs as the server). I will just write a program to convert all the wikitext to HTML on a PC, and somehow produce a database based on a wikipedia XML dump. There is no HTML renderer for j2me.
Many thanks!

Related

Internet Explorer Bug

I don't know at what point I messed my Pocket IE, or maybe which files I didn't install from the Ext Rom, but my MDA Internet Explorer will not open many sites, most often those that require special cookies. I have cookies enabled, I can surf many sites, but certain stes, that work on my wifes MDA, won't work on mine.
Is this some JAVA midlet missing, or some deleted folder that stores cookies? Any ideas?
Java not enabled on browse error message
I get a similar error when I try to access a web site that requires a java enabled browser (works fine from my PC), but not from XDA mini. error message states "Java not enabled on your Browser"
Does anyoe have a suggestion on how to enable Java on teh browser under pocket 2003 op sys?

Viewing IE

I can not get links to appear within Hotmail or view webcams.
Is this a limitation of IE on windows mobile or have I not got something configured incorrectly. I have tried the IE6 regedit.
lochindaal said:
I can not get links to appear within Hotmail or view webcams.
Is this a limitation of IE on windows mobile or have I not got something configured incorrectly. I have tried the IE6 regedit.
Click to expand...
Click to collapse
Don't know about Hotmail but webcams often are Java applets and so they require a JVM installed. A solution may be buying latest Netfront 3.3 when it'll be released (it has JVM) or try an alternative PIE-compatible JVM (see http://www.pocketpcmag.com/blogs/htsrv/trackback.php?tb_id=637)
bye

Writing a local proxy server WM6

Hi all,
I've written a proxy server in C# for my HTC Wizard running WM6 with the .NET Compact Framework. Its configured to route My Work Network through a proxy address 127.0.0.1 on port 8888. My proxy program runs a TcpListener on this port and IEMobile browser requests are sent to my proxy which goes to the web, gets each required file and returns them to the browser.
It works fine for files of the type htm, html, gif, png, jpg - but whenever a page uses css or js, it will not load the pages. Any clues as to why??
The program is simply an intermediate agent that reads and writes bytes from the browser and the remote point. Does anybody know why these different types of files never load correctly??
Please, any help or debug ideas is appreciated.
Thanks,
Nick
etnaelk said:
Hi all,
I've written a proxy server in C# for my HTC Wizard running WM6 with the .NET Compact Framework. Its configured to route My Work Network through a proxy address 127.0.0.1 on port 8888. My proxy program runs a TcpListener on this port and IEMobile browser requests are sent to my proxy which goes to the web, gets each required file and returns them to the browser.
It works fine for files of the type htm, html, gif, png, jpg - but whenever a page uses css or js, it will not load the pages. Any clues as to why??
The program is simply an intermediate agent that reads and writes bytes from the browser and the remote point. Does anybody know why these different types of files never load correctly??
Please, any help or debug ideas is appreciated.
Thanks,
Nick
Click to expand...
Click to collapse
wow, nice.
i could really really use your source code for something im working on.
care to share?
don't worry, it's not anything im planning to publish soon, just a personal project.
and if i ever will, it will be with your full concent and you will be credited.
[email protected]
thank you!
Everybody who want to share their internet connection on the phone via wifi to their local network via a proxy on the phone raise their hands.
woohoo! me me me! xD
actually, it is the proxy itself that i need for other functionality. thats why i need the source code...
me too, the proxy not the source code
etnaelk said:
Hi all,
I've written a proxy server in C# for my HTC Wizard running WM6 with the .NET Compact Framework. Its configured to route My Work Network through a proxy address 127.0.0.1 on port 8888. My proxy program runs a TcpListener on this port and IEMobile browser requests are sent to my proxy which goes to the web, gets each required file and returns them to the browser.
It works fine for files of the type htm, html, gif, png, jpg - but whenever a page uses css or js, it will not load the pages. Any clues as to why??
The program is simply an intermediate agent that reads and writes bytes from the browser and the remote point. Does anybody know why these different types of files never load correctly??
Please, any help or debug ideas is appreciated.
Thanks,
Nick
Click to expand...
Click to collapse
You alos need to do some header parsing. If you don't want to do much work, your best bet is just converting my Java language HTTP proxy to C# - it has no problems with any special files (and also supports HTTP Post). See http://www.pocketpcmag.com/blogs/index.php?blog=3&p=453&more=1&c=1&tb=1&pb=1 for the source & more info.
Thanks, Menneisyys.
I'll give it a look and hope it solves my problems. I definitely haven't done any header parsing so lets hope...
On an aside, I was wondering if anybody has any resources on the Connection Manager API for mobile device networking? I am looking for some sample code in C++ which it is native or better yet if anybody has ever ported it to C#. Or if anybody knows how to port a .h file to C#.
Any help is appreciated.
Thanks,
Nick

Android SQL Client

Hi All,
Does anyone know of a SQL client for Android? Just something for running basic queries when I need to check on a system and can't be arsed waiting for a computer to boot up. The databases I use are MS SQL Server.
I've searched about and can't find anything. I've also had a look at the dev docs for Android and it looks like it should be straight forward using the java.sql class but unfortunately Java isn't in my skill set at the moment and the day job & life in general doesn't leave me with much time to learn it.
If there isn't a program does anyone have any plans to write one ;-)
Cheers
Keith
Anyone ???
It'd be pretty darn insecure to open up your databases to use a remote client like that, why not just use something like phpmyadmin for it? It runs fine in the android browser and theres tons of alternatives that probably have iphone themes that would work great. Alternatively you could get debian set up and grab one of the hundreds of apps to do it in the repository
I need this as well. I'm constantly on SQL Enterprise Manager on my PC and when mobile, I have to teamviewer to my desktop and run queries there, which is such a torture.
I've bought RemoteDB, which I can't seem to get to work properly, I can't switch databases and the connection registry is very confusing.
Anybody?!
Also interested
I'm also interested in this topic.
As far as opening your db's up to the internet, that's a bogus argument. Anyone remotely managing enterprise databases will be using a vpn tunnel, and not the open web.
Having an Android app to connect to Microsoft SQL and Oracle would be extremely helpful. I've been trying to figure out how to mod Oracle's SQLDeveloper to do just that but without any success so far.
aSQL - Remote Control, new launch
Remote Control Client for Microsoft SQL Server 2005/2008/2008R2/2012.
aSQL - Remote Control Lite is a powerful Microsoft SQL Server client providing Access to your server in your Pocket. Access all of your databases, Jobs and Processes as well from your mobile device.Simple and Fast application providing advanced features.
aSQL - Remote Control Lite Provide features like:
- Providing connectivity to different servers on your Network.
- Ability to store Server Information for future use.
- Job START/STOP only a click away.
- Kill any running Processes From your mobile device.
- View Databases details - View File size.
Google Play Store link -
"market://details?id=com.sqlforce.aSQL"
SQL Client
Hi Guys
I looked for something like this for a while as well, and couldn't find anything that did what I wanted, so I made one myself
Key features I wanted are the following
Be able to connect directly to a db server. I used the jdts jdbc driver for Java to get this right
Be able to connect to any SQL Server db. I'll add support for Postgres and MySQL if this gains any popularity
List of all databases on the server (excluding system dbs) and allow you to quickly switch between them
List tables in the currently selected db, and generate Select statements for them
List stored procedures in the currently selected db, and pull the code for them so you can change it
Use a tabbed interface for the different sql queries, to allow you to run many queries at once
This is all done and works really well. Large queries take longer to run than they would on a pc, but they run nonetheless.
Let me know what you think, and feel free to suggest features. If enough people like it and use it, I'll bite the bullet and buy the developer so I can publish it on the Play store
I hope you enjoy it
ps. The installer is signed with the standard testing key, so you will need to go into your settings and allow applications from unknown sources
pps. I ask for internet access to get access to the network sockets, but dont actually connect to the internet.
danegoodwin -
I've downloaded it and played with it a bit - looks good. One feature I'd suggest off the top is storing the connection info. It's a pain having to enter the server address and username each time.
If you are still looking for a SQL client I had written one as well.
It should cover most of the popular databases and works well with tablets and phones.
SQLTool Pro
https://play.google.com/store/apps/details?id=com.nraboy.sqltool
I'm also open to suggestions and questions if anyone decides to give it a try.
nraboy said:
If you are still looking for a SQL client I had written one as well.
It should cover most of the popular databases and works well with tablets and phones.
SQLTool Pro
https://play.google.com/store/apps/details?id=com.nraboy.sqltool
I'm also open to suggestions and questions if anyone decides to give it a try.
Click to expand...
Click to collapse
so, this one does BOTH MySQL and MS SQL, and, your other one *just* MySQL ?
thanks, anyone
abbots said:
so, this one does BOTH MySQL and MS SQL, and, your other one *just* MySQL ?
thanks, anyone
Click to expand...
Click to collapse
Correct. The pro version will handle MySQL, MS SQL, PostgreSQL, Sybase, and Oracle up to version 10.1.
The MySQL version is strictly MySQL.
nraboy said:
Correct. The pro version will handle MySQL, MS SQL, PostgreSQL, Sybase, and Oracle up to version 10.1.
The MySQL version is strictly MySQL.
Click to expand...
Click to collapse
thanks for reply (and for nice app!)
nice, looks good... even better, seems to work well....connected to remote MySQL OK
suggestion: please auto-suggest correct ports for relevant SQLs
so, editing can only be done via queries ? (time to learn SQL syntax..?)
next, I'll try connecting to MS SQL, whilst I know a tiny bit about MySQL, I know nothing about MS, might be asking for help...
Nic,
need some help, if you can:
having issues with MS SQL, MS SQL is on a cloud server, for all I know, port could be blocked..
I've setup definition with port 1433, get 'failed to connect'
how to t/s outside of the app ?
should "telnet host 1433 " work ?
I'm getting
# telnet mssql2008.xx.yy 1433
Trying 202.111.22.33...
telnet: connect to address 202.111.22.33: Connection timed out
what else can I try ?
thanks for any pointers!
abbots said:
thanks for reply (and for nice app!)
nice, looks good... even better, seems to work well....connected to remote MySQL OK
suggestion: please auto-suggest correct ports for relevant SQLs
so, editing can only be done via queries ? (time to learn SQL syntax..?)
next, I'll try connecting to MS SQL, whilst I know a tiny bit about MySQL, I know nothing about MS, might be asking for help...
Nic,
need some help, if you can:
having issues with MS SQL, MS SQL is on a cloud server, for all I know, port could be blocked..
I've setup definition with port 1433, get 'failed to connect'
how to t/s outside of the app ?
should "telnet host 1433 " work ?
I'm getting
# telnet mssql2008.xx.yy 1433
Trying 202.111.22.33...
telnet: connect to address 202.111.22.33: Connection timed out
what else can I try ?
thanks for any pointers!
Click to expand...
Click to collapse
Hinting a default port is a good idea. I will see about adding in an upcoming release.
Yes right now anything beyond a simple select or delete must be done with a custom query. My goal is to make it more like the desktop editors, but since I am the only developer it might take a while. But I am not saying it won't happen.
If telnet is failing to connect then there is a firewall rule blocking your IP. Three things could fix this.
1. Add your IP to the database allow list (talk to the DBA)
2. If you can connect to the network the DB is on via VPN then you should. The db might be restricted to local IP
3. Use the SSH features of SQLTool to connect to a server on the databases allow list
You were smart to try the telnet. I would have done the same thing.
Feel free to contact me here or through the tools site. I'm happy to help
nraboy said:
You were smart to try the telnet. I would have done the same thing.
Click to expand...
Click to collapse
ahem, not that smart.....
forgot to specify sql type...... ooops
suggestion: don't allow save unless all req. stuff filled in...
OK, I seem to be in.
can I dump/backup with this app ?
thanks.
decent app, well done, wish you success in further development, if I can help in any way, happy to try
now I need to figure out how to dump this MS SQL into my Linux machine
abbots said:
ahem, not that smart.....
forgot to specify sql type...... ooops
suggestion: don't allow save unless all req. stuff filled in...
OK, I seem to be in.
can I dump/backup with this app ?
thanks.
decent app, well done, wish you success in further development, if I can help in any way, happy to try
Click to expand...
Click to collapse
Nice catch on the SQL Type. I will work to correct that.
For dump / backup are you referring to data or structure or both? Right now I have exporting DDL on my things to do list, but if you're referring to something else I'd like to hear it.
Thanks for the compliments on my app. I definitely want to hear more suggestions if you have them. Also please don't forget to rate well when you get a chance

Easy Remote File Access Idea

Let me start by saying this: I do realize there are other methods to accomplish this, and that this method will not work for everyone. But for me it's simple to set up, as well as neat and tidy.
I've started combining the use of Dropbox with Wyse PocketCloud for Android. I'm sure everyone is already familiar with Dropbox. Wyse PocketCloud, if you don't already know, is a fantastic RDP client for Android.
With this setup, I'm able to have access to any file on my computer at any time from anywhere, with acceptable levels of security.
Using Wyse, I remote logon (yes, even over 3G) to my desktop at home. I then use Wyse to find the file I need on my desktop, and then copy it onto the Dropbox folder on my desktop. Through Wyse, I've remotely added a file on my home computer to my Dropbox cloud. I can then logoff from Wyse, open up Dropbox on my phone, and download that file to wherever I need it. I've already been saved by this - I was able to obtain a copy of an important PowerPoint for work from my desktop, download it to my SD card, then mass-storage it onto my work computer.
There are other great uses for Wyse, but this is my favorite. I hope and pray they expand the Beta.
Steps:
1. RDP compatible OS (I'm running Windows 7 Ultimate)
2. Download Wyse PocketCloud from Android Market
3. Sign up for Dropbox and install the client to both your home computer and your Android device
4. Enable RDP on your home computer
5. If you're home computer is behind a router or other type of firewall, don't forget you'll need to set up an appropriate port forwarding rule!
This was a fantastic solution for me - I hope it helps others as well. If anyone else can think of creative uses for Wyse, I'd love to hear them.
i use wyse all the time. for the above mentioned use and i run a dlna server on my pc to feed media to other devices in the house, so if i need to share a new folder etc, and i dont want to go to the computer, i just wyse it.
Alternative - e-mail the file to yourself (using Wyse or another RDP Client)
Another alternative is to use an RDP Client to e-mail the file to yourself, and then access the e-mail on your phone.
RDP is vulnerable to a man-in-the-middle attack unless you are using certificates. I've also seen many a winbox hacked via RDP in the past, not really sure if they just used dumb passwords and accounts or what, but in each case the box was owned by a bot. As a result, I don't allow RDP anywhere at any time to any box.
If I want remote access RealVNC with encryption (Only in paid version) but don't think there is a Droid app for that yet, or I use something with an SSH tunnel.
As for files, I have files on a network share which is then mounted via NFS on an internal network to a Unix server which I can then hit with something like AndFTP using an SSH connection to get and put.
This includes access to all MP3, ISO, Movies, data, web etc.. access
This is not limited to use via a smartphone though, any SSH file transfer program will work from any Internet facing box.
I've used dropbox in the past and it is okay, but the above gives me full access to files without pre-planning what I am going to need.
RDP is vulnerable to a man-in-the-middle attack unless you are using certificates. I've also seen many a winbox hacked via RDP in the past, not really sure if they just used dumb passwords and accounts or what, but in each case the box was owned by a bot. As a result, I don't allow RDP anywhere at any time to any box.
If I want remote access RealVNC with encryption (Only in paid version) but don't think there is a Droid app for that yet, or I use something with an SSH tunnel.
As for files, I have files on a network share which is then mounted via NFS on an internal network to a Unix server which I can then hit with something like AndFTP using an SSH connection to get and put.
This includes access to all MP3, ISO, Movies, data, web etc.. access
This is not limited to use via a smartphone though, any SSH file transfer program will work from any Internet facing box.
I've used dropbox in the past and it is okay, but the above gives me full access to files without pre-planning what I am going to need.
Click to expand...
Click to collapse
That's really helpful information. It sounds as though there may not be a fully secure method to access your root that way? Wow, even just typing that makes me glad I don't really have sensitive info on that box.
Sent from my ADR6300 using XDA App

Categories

Resources