Using JSR82 in Java Application - java

I am trying to write a Java application showcasing Bluetooth features. On general search, I found JSR82 has been defined for the same.
I am not able to figure out exactly how to use it. I am using standard java 1.6 and I believe for JSR82 implementation I would need J2ME running.
I need help to understand how to use the 2 java editions together. I have never worked with the Micro Edition before. Would appreciate any inputs.
Thanks & Regards,
Keya

You can simple try using a JSR82 implementation on your mobile device - it should work.
This site has some good information about it.
Here are two JSR82 implementations I know of:
Bluecove
Avetana

Go to http://java.sun.com.
Install the jdk and the latest full version of Netbeans for your linux computer.
Use Netbeans to create a HelloWorld mobile application
Run it in the Wireless ToolKit emulator packaged into Netbeans.
That should work right out of the box.
You then need to read the JSR-118 specification to understand how a MIDlet works.
Then read the emulator documentation to figure out how to provide bluetooth data to your MIDlet.

Related

User interface in Java ME

How can I use an user interface (GUI) in Java ME? I followed some tutorials and all them point to the javax.microedition.lcdui package, but it just doesn't exist in Java ME 8 SDK.
Since I can't find that package, and SDK 3.4 gives me errors in Netbeans (I activate it and add it as platform, but it doesn't appear when I have to choose a simulation platform when creating a project.
You can see here how I don't have the LCDUI package:
I need some help in order to use GUIs in this Java version.
Thank you.
As far as I know JavaME 8 is targeted at the embedded space and isn't supported on phones etc. It should have a profile without any UI elements and might have JavaFX embedded.
I am unaware of any device in the field that supports JavaME 8 but might be missing something.

Python for Android Apps

I've learnt python recently and I want to make an app for android. But everywhere on the net, it seems Java and Eclipse are the only ones that can be used.
So, my question is:
1) Can I use python to make an android app?
2) What kind of platform should I use to make an app with python?
Thanks guys!
If you're just looking to run Python scripts, try QPython.
If you're looking to make your Python code run like a native app, or just something more robust than the above, try SL4A.
If you're looking to effectively use Python as a library, and compile an .apk with the Python library included, try Kivy: github.com/kivy/python-for-android.
That said, you'd likely get a lot of benefit from learning Java, and not just for programming natively in Android (which would give you access to a much wider feature set and make your app run more efficiently).
Check out the Scripting Layer For Android, aka SL4A.
Here is a blog for getting started. The blog promises more entries in the series but there don't seem to be any. Still, it is a great starting point. There's quite a few parts to pull together so be patient and check the bottom of that blog entry for dozens of useful links.
If you want to contain everything to the Android device, including the IDE (pretty slick), check this out.
Here's a book from APress that could help with more advanced concepts: Pro Android Python with SL4A

Java or Objective-C for MacOSX (back to 10.3 & PPC)

We are starting some new app development but because of special business requirements, need to support back to Mac OS X 10.3 as well as PPC/Intel CPUs.
The latest Xcode 4 isn't an option, from what I can tell it only goes back to 10.5 and doesn't support PPC at all. Is Xcode 3 an option? Would it be easier to just use Java?
P.S. From anyone experienced in either, can you please comment on some of the pros and cons you've bumped into?
EDIT
As requested, here's a brief overview of the app:
The app needs to talk to a server which will expose JSON web services. The app itself needs to be built in a way that will allow plugins (not 3rd party, but in-house with the ability to customize which features the customer owns). Each plugin will gather specific information about the host OS - such as running apps, users, CPU usage, etc.
If you can find a way to make Objective-C work with your requirements, it is worth it in my opinion.
I myself am a former Java developer who has moved into the creation of native Mac OS and iOS apps. I tried using Java for some of my early Mac OS projects and always found the support to be lacking. It can be done, but it was always more difficult than it should've been and never worked as well as a native app.
Here is a link to another SO post that describes some workarounds for getting older SDK versions working in Xcode 4. I can't vouch for how well they work with current versions of Xcode, but it's worth trying.
In view of your requirements, especially the need to do some system evaluation, I would strongly recommend to use Objective-C and the Apple development environment. You will have a lot of difficulties using Java to retrieve the neccessary information about the host OS, that you want to use in your application.
You could try to run Xcode with older SDK versions, but I have virtually no experience on OSX to give you solid advice on how to do this.
EDIT: My Xcode 4 gives me an option to select a "Deployment Target", where I can go back to supporting 10.1, but I have no idea, if this is the right thing...
Well,
Apple isn't a Java friendly company. You don't have all the bindings you may need on their JVM.
So I strongelly recommend (given that your project will be Mac OS X only) Objective C instead of Java
I program in Java but on Mac OS X, Objective-C is better than Java because it is faster and developed by Apple itself. Moreover, if you develop a program in Objective-C, you can sell it on the Mac App Store while if you develop it with Java you can't.
So go with Objective-C.

What are the available J2ME SDK using Java code?

I am a Java J2SE developer, and i want to learn J2ME to start creating mobile applications.I see i can use the default Oracle Java ME SDK. Do you know other Mobile SDks that are Java based, as i want to write Java code ?
IMHO Android is the way to go if you want to do java for the mobile, even better than j2me.
see Android SDK
Here's a list of Java ME SDK suppliers / vendors that I was able to find using Google:
Motorola
LG
Nokia
Samsung
Sony Ericsson
RIM
and probably more
Netbeans Java ME plug-in is kinda the same than Java ME SDK, but obviously with all the options Netbeans include. That's the one I use.
And if you're decided to go on with Java ME, I suggest you to have a look to LWUIT, in order to make nicer interfaces within the own Java Me technology.
Eclipse works just fine for this purpose. Have a look at Mobile Tools for Java (formerly known as EclipseME).
From the eclipse me link:
EclipseME is an Eclipse plugin to help develop J2ME MIDlets. EclipseME does the "grunt work" of connecting Wireless Toolkits to the Eclipse development environment, allowing you to focus on developing your application, rather than worrying about the special needs of J2ME development.
If you want Java for mobile and not necessarily J2ME, you can also try Android and Blackberry development.

How to run Java USB API for Windows using Eclipse

I understand that there is no complete support for USB for Java in Windows. But jUSB provides a Java USB API for windows which does not provide support for the complete functionality though.
I am trying to install the Java USB API and try it, and the steps provided say he following,
jUSB DLL
Copy the jusb.dll from the folder \InstallationFiles\JusbDll to the \system32 folder
of your Windows directory.
Compile the usb.windows package in Netbeans. Attach a USB device to the
USB and run RunUSBControllerTest.
I am a novice java user, and I currently work with Eclipse. I do not understand what to compile and how to run RunUSBControllerTest alone. Could someone please tell me how to run the application using Eclipse.
http://www.steelbrothers.ch/jusb/
There are other question in stackoverflow like this.
I recommended you:
Learn java before fight with this more complex and undocumented topic.
Use standards APIs like JSR-80. This standard could be a good search start point.
See this thread in forum.java.net
I hope this helps and good luck.

Categories