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 New comer to J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "New comer to J2ME" Watch "New comer to J2ME" New topic
Author

New comer to J2ME

Gus Mus
Ranch Hand

Joined: Feb 28, 2003
Posts: 53
Hi I am new comer to J2ME,
have several questions to who already expert on it.
1. Can I create application to save something to the cell/device and read it later on ?
2. Do we have to care about the type of device ?
like the resolution and etc. Since Java should be write once run anywhere.
Thanks for the info
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
1. Can I create application to save something to the cell/device and read it later on ?

Yes you can. Although I think you have to use the same application (called MIDlet) to access that persistent memory space you saved the "thing" into. Can anyone confirm/correct this?
2. Do we have to care about the type of device ? like the resolution and etc. Since Java should be write once run anywhere.

The code is WORA but the UI is not guaranteed to stay usable... In practice you may need to worry about available memory, CPU power, available persistent memory, network connectivity features, screen size, and the list goes on.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Gus Mus
Ranch Hand

Joined: Feb 28, 2003
Posts: 53
Thanks for the answers... Now I am going into it (J2ME)
Any of you have recommendation which device is the best to program J2ME ?
(I mean by using this device then worries about things like memory,CPU power, resolution, etc can be reduced)
Frank Manno
Ranch Hand

Joined: Apr 06, 2003
Posts: 48
Originally posted by Lasse Koskela:

Yes you can. Although I think you have to use the same application (called MIDlet) to access that persistent memory space you saved the "thing" into. Can anyone confirm/correct this?

My understanding was that as long as its not any sensitive device-dependant data, it could be accessed from another MIDlet. I remember reading about the security that prevents a MIDlet from accessing certain files, but I thought a regular text-based file was accessible...
Can anyone confirm this for us?


-- Frank
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Any of you have recommendation which device is the best to program J2ME ?
(I mean by using this device then worries about things like memory,CPU power, resolution, etc can be reduced)

I'd say Nokia 3650/7650 or Sony-Ericsson P800 (see this benchmark). They have relatively large screens and a lot of memory/processing power.
Check out javaperformancetuning.com for J2ME performance tuning tips, if necessary.
Daryl Wilding-McBride
Author
Ranch Hand

Joined: Jul 18, 2003
Posts: 60
Originally posted by Frank Manno:
Can anyone confirm this for us?

In MIDP 1.0, MIDlets can share an RMS database as long as they belong to the same MIDlet suite (i.e. packaged together in the same JAD). In MIDP 2.0, you can decide whether you keep this behaviour or whether you want any MIDlet to access it.


Daryl Wilding-McBride<br />Author of "Java Development on PDAs" (ISBN 0-201-71954-1)<br /><a href="http://www.javaonpdas.com" target="_blank" rel="nofollow">http://www.javaonpdas.com</a>
Frank Manno
Ranch Hand

Joined: Apr 06, 2003
Posts: 48
Thanks for clearing that up Daryl... I remember reading somewhere that it was accessible. I did not know that it was an option available at the programmer's discretion. It makes more sense to allow the user to have that control rather than the developer.
Daryl Wilding-McBride
Author
Ranch Hand

Joined: Jul 18, 2003
Posts: 60
Originally posted by Frank Manno:
It makes more sense to allow the user to have that control rather than the developer.

The developer has the choice in the openRecordStore method call. The authmode parameter can be AUTHMODE_PRIVATE (which mimics the MIDP 1.0 behaviour) or AUTHMODE_ANY (where any MIDlet on the device can access the database).
[ July 25, 2003: Message edited by: Daryl Wilding-McBride ]
Frank Manno
Ranch Hand

Joined: Apr 06, 2003
Posts: 48
Originally posted by Daryl Wilding-McBride:

The developer has the choice in the openRecordStore method call. The authmode parameter can be AUTHMODE_PRIVATE (which mimics the MIDP 1.0 behaviour) or AUTHMODE_ANY (where any MIDlet on the device can access the database).
[ July 25, 2003: Message edited by: Daryl Wilding-McBride ]

So if the developer uses the AUTHMOD_ANY constant, does that mean that his/her MIDlet can access any database on the device, or does it give permission to other MIDlets to access the databases which it creates?
If it's the former, it would defeat the purpose of security. I mean, any developer could write a program to erase everything in the RMS!
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
is J2ME easier to learn and apply or harder if one has good and strong foundation at J2SE?


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
is J2ME easier to learn and apply or harder if one has good and strong foundation at J2SE?

Easier. Can you think of an example where a strong J2SE background would be a disadvantage for learning a technology based on the Java programming language and virtual machine?
Daryl Wilding-McBride
Author
Ranch Hand

Joined: Jul 18, 2003
Posts: 60
Originally posted by Frank Manno:
So if the developer uses the AUTHMOD_ANY constant, does that mean that his/her MIDlet can access any database on the device, or does it give permission to other MIDlets to access the databases which it creates?

The developer who creates the RMS database decides whether it will be available to all MIDlets or only those within the same suite.
Daryl Wilding-McBride
Author
Ranch Hand

Joined: Jul 18, 2003
Posts: 60
Yes I agree that it's easier if you have a J2SE background. J2ME is based on J2SE, so if you understand the "base", then it's easier to understand the additions and subtractions that comprise J2ME.
Frank Manno
Ranch Hand

Joined: Apr 06, 2003
Posts: 48
Originally posted by Daryl Wilding-McBride:

The developer who creates the RMS database decides whether it will be available to all MIDlets or only those within the same suite.

Okay... That makes more sense! I was beginning to think that the developer decides whether his app access OTHER databases, which doesn't make much sense -- security wise.
Thanks for clearing that up!
Frank Malinowski
Ranch Hand

Joined: Jul 24, 2003
Posts: 30
Originally posted by Gus Mus:
Hi I am new comer to J2ME,
have several questions to who already expert on it.
2. Do we have to care about the type of device ?
like the resolution and etc. Since Java should be write once run anywhere.
Thanks for the info

If you create a normal application using forms, etc. you will not have a problem. One of the features of J2ME is that it is device independent in that you tell it that you want a text box or a choice item and the device that the program is running on decides how to display that particular item. Your program might look different on each device but it will run the same.
Having said that there are ways to display by pixel EXACTLY what you want to appear on the screen but this is something that you would only want to use if say you were designing a particular type of game or something of that nature. As the platform matures we are seeing more and more emphasis on standards.
The only problem is that even though the platform is improving there aren't a lot of devices out there that have the latest MIDP 2.0 built in.
Later, Frank
 
 
subject: New comer to J2ME
 
Similar Threads
capabilities of J2ME
Hi.I need help
new comer
Loading music file and playing it.
HFSJ Hype or real?