File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes Android or Iphone? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Android or Iphone?" Watch "Android or Iphone?" New topic
Author

Android or Iphone?

Jane Jukowsky
Ranch Hand

Joined: Mar 28, 2009
Posts: 145
I am thinking of going mobile. No previous mobile experience. Terrible time crunch (as always). All I need is a simple app to scan a barcode (that's emulated keyboard), get an RS232 reading from a scale, and then send these two numbers to the server.

1) What time estimate should I put on this project, given my total ME newbie status? (I've got tons of experience with SE though)
2) Android or Iphone? What are the pros and cons?
3) I've been told that only Android tablets have 5v necessary to hook up RS232; 3V phones without an inverter simply don't provide power transport to usb, and the rs232 to usb adapter gadget needs power from the USB side (is that true? Why not power from the rs232 side?)

Thanks!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41791
    
  62
First off, you're talking about JME - you're aware that neither Android nor iPhone use JME, right? Android development is done in a subset/superset of JSE 5, while iPhone development is done in ObjectiveC (OO, but rather different from Java).

I don't think I've encountered (or heard of) a cell phone that has a serial connector, so that will be a challenge. Or does the converter take care of that if there's a USB connection? Hardware details will be specific to the handset, so I'd imagine that Android phones may differ in what they offer.

As to processing barcodes, for Android you can use http://code.google.com/p/zxing/. I'm sure there's something similar (maybe even from Apple) for the iPhone.


Ping & DNS - my free Android networking tools app
Jane Jukowsky
Ranch Hand

Joined: Mar 28, 2009
Posts: 145
Ulf Dittmer wrote:First off, you're talking about JME - you're aware that neither Android nor iPhone use JME, right? Android development is done in a subset/superset of JSE 5,

Say what? I was not aware of that! What does it have for GUI, anything that looks like awt or Swing?

while iPhone development is done in ObjectiveC (OO, but rather different from Java).

IPhone has Java now, right?

I don't think I've encountered (or heard of) a cell phone that has a serial connector, so that will be a challenge. Or does the converter take care of that if there's a USB connection?

Yup! But apparently only if there is power transport inside the USB, and I've been told mini-usb on most cell phones does not have that, because the power transport needs to be 5V, and phone batteries tend to be 3V and no inverter.

Hardware details will be specific to the handset, so I'd imagine that Android phones may differ in what they offer.

I've been told that android tablets offer the right usb (with power), but not android phones. Can anyone verify that?

As to processing barcodes, for Android you can use http://code.google.com/p/zxing/. I'm sure there's something similar (maybe even from Apple) for the iPhone.

I am familiar with that one and have used it on a PC, good library!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41791
    
  62
What does it have for GUI, anything that looks like awt or Swing?

Something Android-specific, not related to either AWT or Swing.

IPhone has Java now, right?

No, and likely never will.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

I think these discussion are worth a visit too:
1. iPhone or Android
2. J2ME vs Android vs iPhone vs Symbian..


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
A few simple thoughts on the iPhone/Java (JME) combination

http://blog.taragana.com/index.php/archive/how-to-install-compile-run-java-on-iphone/
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41791
    
  62
http://blog.taragana.com/index.php/archive/how-to-install-compile-run-java-on-iphone/

The commercial library discussed there likely violates the newly changed AppStore rules against translated code, so its future viability is in doubt.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11458
    
  93

Dawn Charangat wrote:A few simple thoughts on the iPhone/Java (JME) combination

http://blog.taragana.com/index.php/archive/how-to-install-compile-run-java-on-iphone/

Unfortunately due to changes to the iPhone Developer Agreement the 1st option mentioned is now banned by Apple.


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16051
    
  21

I wouldn't count on running Java on an iPhone, especially if you want it to be an "Apple Store" iPhone app. Apple is far too controlling and one of the earliest manifestations of that was their ban on any sort of internally-programmable system, whether it's Java or a Commodore-64 (or Apple II) emulator.

My Android phone has a "B-type" mini USB connector on it. To hook it up to a scale (how does a scale figure into "portable"?), you'd need a base computer (since the phone USB is a peripheral, not a host). I don't know where the 3v comes in. It should be 5V just like regular USB, but the 5v goes in (that's how the phone gets charged), not out.

Reading barcodes is the easiest part of it. And, since the phone wasn't available without a data plan, I'm guaranteed I can send the scanned code to the server of my choice, so if a scale was also logged into that server, I could combine the 2 on the server end, and even use GPS to indicate which scale if I had roaming access to scales.


Customer surveys are for companies who didn't pay proper attention to begin with.
Jane Jukowsky
Ranch Hand

Joined: Mar 28, 2009
Posts: 145
Hi Tim,

Lots of cool ides, thanks.

OK, IPhone is out then.

My Android phone has a "B-type" mini USB connector on it. To hook it up to a scale (how does a scale figure into "portable"?), you'd need a base computer (since the phone USB is a peripheral, not a host).

Ouch! I don't want a base computer by every scale. I've read somewhere though that someone's converted phone usb into a host somehow, I'll look for a link. I think it would be cheaper then to buy an rs232 to bluetooth adapters and make the scales bluetooth. But then, how do you read bluetooth?

BTW, who said anything about portable? :-)

Reading barcodes is the easiest part of it. And, since the phone wasn't available without a data plan, I'm guaranteed I can send the scanned code to the server of my choice, so if a scale was also logged into that server, I could combine the 2 on the server end, and even use GPS to indicate which scale if I had roaming access to scales.

How do you get your barcode reading?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16051
    
  21

Jane Jukowsky wrote:Hi Tim,

Lots of cool ides, thanks.

OK, IPhone is out then.

My Android phone has a "B-type" mini USB connector on it. To hook it up to a scale (how does a scale figure into "portable"?), you'd need a base computer (since the phone USB is a peripheral, not a host).

Ouch! I don't want a base computer by every scale. I've read somewhere though that someone's converted phone usb into a host somehow, I'll look for a link. I think it would be cheaper then to buy an rs232 to bluetooth adapters and make the scales bluetooth. But then, how do you read bluetooth?

BTW, who said anything about portable? :-)


Kind of went with the idea of "phone".

As for Bluetooth on Android. Google is being very slow on that one, and I'm annoyed. I have a nice little folding Bluetooth keyboard that I was able to use with my old Windows Mobile device. The Android phone can't even see it, much less have an API for it. Right now, about all Android supports is audio Bluetooth (things like headsets). Not even Bluetooth Beaming.


Reading barcodes is the easiest part of it. And, since the phone wasn't available without a data plan, I'm guaranteed I can send the scanned code to the server of my choice, so if a scale was also logged into that server, I could combine the 2 on the server end, and even use GPS to indicate which scale if I had roaming access to scales.

How do you get your barcode reading?


The Google folks wrote an app that used the camera plus zxing. So I can either use that app or write my own and call zxing. The google app looks up bar codes on the Internet. It's actually quite good except that I don't have a macro lens on the camera, so that limits focal distances. In particular, the depth of scanning a UPC label on canned goods is pretty hopeless.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Android or Iphone?