Hello% Habrayuser%!
Disclaimer:
Just want to say that this article is designed for beginners and not for advanced gurus.
')
J2ME is dead ... But no!
Information technologies are rapidly developing, with the advent of smartphones, PDAs and other innovations in our lives - people quickly began to forget about phones, the development of programs on J2ME subsided. With tears in his eyes, until his last breath, I want to believe that it is not. And it seems. Tomorrow, you will see new statistics - statistics where the
java 2 micro edition is not inferior to anyone, and even vice versa - is superior in numbers. Alas, this is probably just a dream.
I remember the time when the word “j2me” was on everyone’s lips, and the forums were bent on questions and ideas related to j2me. It was truly a powerful technology! It will remain so for me.
Higher and higher rise the statistics of sales of devices from the installed OS. Statistics is good, but can they
be 100% trusted? For example, I can not, because every day I see a lot of
handsets , people who can easily afford to buy expensive Android or Apple products. But the theme is no less used by ordinary phones, Samsung, Sony Ericsson, Nokia.
And to the question:
- “Why don't you buy a novelty?”
Answer with pride:
- "It suits me and everything here."
However, the principle of "Only for calls" in my case does not work. Often I notice how friends in full force use the functionality of a simple phone. When you need to quickly replenish your mobile account yourself or your family - more than once saw that you did it with the help of WM Keeper Mobile. Also recorded meetings, important dates, the organizer works as it should. Read the news in their own RSS Reader'e, Send e-mail and even write to your Blogger-blog. And indeed it is!
After these words, I want to include classical music, discover your favorite NetBeans, and program, program, and program again. What is the way we now do. And we will write Splash Screen, in more detail under the cut ...
I hope that all the necessary tools are already prepared for work? Then proceed!
SplashScreen -
Usually the first thing that the user sees on the screen (in our case, a mobile phone). This is the image that appears during program / game download. Usually a logo or just a picture with information. But this is not always the image, it happens that this is just a text, or there is no splash screen at all. Some J2ME programmers claim that if there is no such “splash” in the application, this is already a 25% failure project.
Note: Above the first launch you should already seriously consider. Whatever you place there is your choice. But it should be remembered that it may depend on this whether% user% will continue to work with the product or not. There is also an opinion. that if the user is delighted with the first launch, then even if the inside of the UI is a little pumped up, it will still return to this application. You need to hold the user from the first launch of the application, and what did you think?
As already mentioned above - in Splash usually place a logo, or information. But you can, for example, build in a thematic advertising generator, your imagination. But it is necessary without fanaticism!
But as the great Hypocrates said:
- "
Noli nocere! "
So, the attack to the code. I suggest making a simple Splash Screen. It will display a picture and wait until we press any key. Classic so to speak.
HabraSplash.java
import javax.microedition.lcdui.*; public class HabraSplash extends Canvas{ private int w,h;
Habra.java
import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Habra extends MIDlet { public static Habra habra_midlet; public static HabraSplash splash_screen; public Display disp; public Habra(){ habra_midlet = this; splash_screen = new HabraSplash(); splash_screen.setFullScreenMode(true); } public void startApp() { disp = Display.getDisplay(this); disp.setCurrent(splash_screen); } public void pauseApp() { } public void destroyApp(boolean unconditional) { notifyDestroyed(); } }
Result:
And finally:
For a beginner, programming in java is a very interesting and exciting activity. Do not listen to anyone, time spent is worth it! Studying J2ME will give you OOP knowledge, will teach you to control memory well and many other things.
This is only a primitive example. Further - more interesting ...
As the "Hungry" from Irkutsk says:
- “Drink coffee, write Java!”
Goodbye.