I have just started to try and learn JavaME and I'm quite confused how it works and how to piece it all together.
For my first task i thought a simple application would be the best approach. I want to create an app that lets the user input a word into a TextField() and then press a button or activate a function that sends this input to a server. The server responds by sending back "OK".
This is simple enough because i have written a swing application that can send/recieve data from a tomcat server, all it takes is a MouseListener and an InputStream.
I would now like to make a simple app like that using JavaMe. I cant however work out how. I have created a form with an attached TextField that allows the user to input text and created and an exit button that quits the application.
How would i now go about creating a command that takes the text value from the TextField and opens an InputStream.
Thanks for any help in the matter.
You can use HttpConnection
much info can be found here !
http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/io/HttpConnection.html
Related
If I have a random program, that shows some text and has some text input, is there a way to write a java program, that reads that text labels and/or fill that text input fields and press an ok button?
Text applications are things that run on the cli, and have no windows. On Microsoft Windows the 'dir' command is an example.
Graphical applications are things that the beginning user might see, and has buttons, text boxes, scroll bars and stuff like that. On Microsoft Windows the 'paint' program is an example.
Web applications are websites that provide front ends as web pages. The 'gmail' application is an example.
If you want to interact with an application using Java, the application type will determine your approach.
text application - use ProcessBuilder, it's a java class designed to launch and (to a degree) interact with processes through stdin, stderr, and stdout.
Graphical application - It depends on the graphical widgets the application uses. If those are not supported by a library that can navigate the presentation, then input is limited to x,y coordinates from the application's origin, and input could fail to go into the right component.
Web applications - Use selenium. It is a custom web browser solution that permits testing of web sites; but, you could use it for your task. It is big and complicated, but considering what is required for this task, it is comparatively easy to use.
Yes you can write a new program that can give input and trigger the service of 'OK' key.
Your first program needs to be designed in the way that - it should accept the input from second program.
You can design the first code as web service in a web application . your first program will be web service provider and second program will be web service consumer.
Using second program you can post the required data to first code. and all the triggers of 'OK' button can be processed from first application.
I made a small program in java
is like a rss checker but when find something I launch this,
java.awt.Desktop.getDesktop().browse(URI.create(relHref));
But now I have a problem,
every time this event trigger i lose focus on the page/program. I wanna open the page without loosing it. Is this possible?
For instance: If I'm watching a movie and the event start i get the focus on the page and I have to stop/restart the movie.
This is almost the same problem i have
Java open html in background but is without a solution :-(
I have a Java application run eclipse, user could input and output by "console"; in the meantime, I want to use another application to handle the "console", for example, another Java application to input "text string" into console, and then output saved into file. I am sorry firstly for the confusing question, do someone have any ideas?
You can run two applications at the same time using using the console. If you look in the console pane, there's a button on the top right that looks like a little compute monitor (Display Selected Console). When running two applications, you can toggle the console view for each application.
I've been pondering over this problem most the afternoon and haven't yet found the most ideal solution so thought I would see what others think..
There is a legacy Win16 application that has to be modified (with the least effort) in order to communicate with a web based application.
The idea is such that in the Win16 app, the user will want to look up a specific code, so they'll click a button which will then launch the browser and allow them to navigate a specific set of pages until they find the result they desire, then they have the option of either pressing Select or Cancel.
Pressing Select should pass back a small string back to the app (around 10 characters) and close the browser. Cancel will likewise send a Cancel message back to the app and again close the browser window.
I can't see many choices available in implementation as the Win16 app is not able to call webservices, so I'm looking at using the clipboard, however that is not without problems.
I hope there's some other alternative I haven't thought of,
As always - all advice appreciated.
Thanks,
i am developing mobile web app using spring(spring mvc). I need to devlope a form which enables the user to upload file(resume) and on submit it will be stored in database.
I am not getting the idea how to finish that!
In the form when i use input type as file, it's working in diffrent manner on diffrent browser. If any one have did it ,please tell me the steps or some working demo at any site.
yes i don't want to use some third party tool.
thanx.
Sorry dude, your kinda SOL on this one. The file input type is a different beast than most. Each browser implements it in their own way, so it will never look the same on multiple browsers. Also, for security reasons, you can't trigger the file inputs with JavaScript, so you can't make an invisible file input that you would interact with through other standard inputs. Many before you have tried, all have failed. I spent days researching possible alternatives when I had nothing better to do, and they all came up against the security issue. Jquery provides the closest thing but still required a browser switch for one of the major browsers (can't remember which one off the top of my head).
So now that the bad news is out of the way, here's what you can do. Put a button on the screen and style it how you like. Put a file input on the screen and using absolute positioning and a higher z-index put it right over the top of your button. Now make it transparent (not display none, but using opacity and filter:alpha styles), now the user thinks they are interacting with your standard button, but the invisible file input above it intercepts the click. Will be the closes you can get to a file input that behaves and looks the same in all browsers.