j2se to j2me WTK bluetoooth communication - java-me

I need some way to communicate between J2SE app and j2me midlet running in emulator in netbeans. How can I achieve this?

Well, technically, Netbeans is a J2SE application so you are already doing this everytime you launch the J2ME emulator.
I expect that when Netbeans launches the emulator, it does it in a way that sends the emulator standard output and standard error back to Netbeans. Presumably using the emulator executable command line parameters. That is one-way communication though.
The debugger inside Netbeans uses a standard protocol to retrieve information and manipulate the emulator:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jpda.html
Of course, using this still restricts what you can do.
Since the emulator is meant to represent a phone, the only pure-Java to pure-Java communication channel is networking. That means opening a tcp, udp or http connection between the two environments. Of course, getting this to work once you put your J2Me application on an actual phone will require quite a bit of setup on the J2SE side of things.

Related

External Accessory Framework can launch terminated app?

Anyone knows if external accessory can launch terminated apps in iOS?
The documentation, from Apple, says that "Declaring support for specific protocols lets the system know that your app can be launched when that accessory is connected".
So if my app register a protocol X, and I connect my iPhone to a bluetooth accessory that has that protocol (X), my app is launched, in background, even if is terminated (like CoreBluetooth)? And I can send commands to that accessory?
Thanks
I think it's clear from the External Accessory Programming Topics, which you quoted (copied below), that the app can be launched, meaning the app didn't need to be already running in the fore or background. However "launched" to me does not imply launched in the background, such as is done with the CoreBluetooth background modes, but rather, it means launched normally into the foreground.
Apps that are able to communicate with an external accessory must declare the protocols they support in their Info.plist file. Declaring support for specific protocols lets the system know that your app can be launched when that accessory is connected. If no app supports the connected accessory, the system may choose to launch the App Store and point out apps that do.

Integrating Arduino code into C++

What library/libraries do I need to add in order to communicate with an Arduino from my desktop Visual C++ application? At this point, all I really want to do is make an LED flash (write high/low to a pin). I already have the desktop application going, but would like it to interact with the Arduino. No, Arduino Uno is not suitable for my case.
Edit 1 Also: I am using a serial USB COM port to connect to the Arduino.
Edit 2 While I am programming in Windows, the application will be designed for Windows or Android.
In the Arduino side, you can just use the built-in Serial to send and receive data.
In the desktop side, refer to this question, which tells you how you can talk to Serial ports in Visual C++
EDIT:
If you are planning to use Java, then you can use the Java Serial port library without any changes to the Arduino code.
Also I would recommend you to use the Android APIs if you want to create an Android app. Using NDK is a real pain and unless you know what you are doing, it will be very tough.
With the arduino connected as a serial device you can have software in the middle which connects it to a network socket.
If you google it you'll find several free programs that do this.
You could even write this yourself in a higher programming language (python, perl, php etc..) very easily, it's just a handful of lines of code.
Then it's quite painless to connect to the arduino, whether its c++ or javascript.

Access to serial port from web browser

I'm trying to access serial port through web browser.
The reason is for downloading firmware to a device that is connected to the same machine that is running the browser (via USB to rs-232).
I'v searched around and have seen that this is doable via Silverlight, but this is Windows only centric since it requires COM support, while my main operating system is Linux, then Windows and then Mac.
I know it's easy to develop JavaFX / QT / Mono / AIR cross platform applications, but those require installing a huge runtime binaries and only then run the application.
I'm trying to keep it really simple, plug your device, visit a web site and it will auto install your application.
Do you guys think it's possible?
Thanks.
https://code.google.com/p/java-simple-serial-connector/
Since Java is cross platform, this would be the only thing required to get the serial support you need in browser.
(not exactly a security nightmare as #"awm" proposed) You could implement a websocket on the localhost, expose a port that is rarely used and call that websocket to open the serial port and feed data to the device to upgrade the firmware.

java.io.IOException: Error in HTTP operation

I am from Bangalore-India. I have developed few J2ME applications that involves client/server interaction through HTTP connection.
I am testing my application on both the leading operators of the country- Airtel and Vodafone. My Midlet works fine with S60rd edition and S40 2nd edition(6030) phone. but as soon as i switch to S40 3rd edition phones like 6233, I am not able to acces the GPRS through my MIDLET. Though the GPRS is working fine with the native phone browser.
Even the MIDLET is not able to access GPRS on currently released phones such as 5310 Xpress Music and 3110 classic.
I have done some packet captures as weel at my server end but the observation is that my request is not reaching upto the server.
I have gone through tons of web references that talk abt APN settings, but no solution has worked for me :(
Is there anyone who can help me out so solve this S40 specific problem.
Thanks in advance.
Can you access GPRS from any MIDlets other than yours? If not, then it sounds very much like a GPRS settings problem.
If I remember correctly, S40 handsets have a Streaming settings option in the settings menu. Ensure you've created a GPRS access point which is referenced in the streaming settings option.

How to run the embedded application

For example, I just developed an embedded SWT application which require CDC/FP1.0 j2se1.3 (I use the eclipse IDE), but how to test this application to see if it is can really run on embedded environment?
Thanks
Not many phones with a proper CDC stack have actually been produced as far as I know.
There was a port of the reference implementation of at least one CDC profile to UIQ 3.x that can be installed on a Sony-Ericsson P990 (and maybe Sony-Ericsson M600, W960 and Motorola Z8) phone.
Presumably, the Sun Java Toolkit for CDC contains an emulator that can run your application.
If none of that works, I would advise searching for what the companies on the two JSRs (JSR 36: Connected Device Configuration and JSR 46: Foundation Profile) expert groups did with CDC and FP.

Resources