Android App taking up a lot of memory - java

While working on my Android application, I recently check a task manager to see how memory my application is racking up.
Right now my application has two ad banners being executed by AdMob services and then an interface fragment for a Google Map. Aside from all that I then have a menu in which I utilize a container to which I add views to it in Java code. I prefer this over a list-view as it is more light weight and easier for me to structure what I want to do with the views (and I can use Androids native animation system when adding/removing the views).
The views being added to the container are being added by a loop structure based on conditions. The views in their interface structure also have a small image-view utilizing a small local drawable.
All of this is somehow adding up to my application 44.8 MB in memory which seems abnormally high from previous development numbers. This is also the first time I decided to use the container to add views through a loop rather then the adapter with list-view method.
Can anyone tell right off hand why my application is taking up so much memory right off? This is my first time utilizing all these components: AdMob Banners, Google Maps, and Containers with added Views.
My LogCat shows no warnings of doing anything inefficiently. Just curious to see if I am doing anything wrong. If anyone has any ideas I am open to provide any source code.

I think 44.8Mb is pretty normal for a modern Android application. My bet is on Google Maps since it's very resource-consuming library (both CPU-wise and memory-wise). Anyway, you can try to sequentially remove each of the component out of app and see how it affects memory footprint.

As Andrey have already said, 44.8Mb is not too much for an Android application. But you can use DDMS to track allocations and heap updates to see exactly is taking up this memory. See this: https://developer.android.com/tools/debugging/debugging-memory.html
Besides, I would recommend using a ListView with adapter because items in ListView can be recycled, which can improve performance considerablly (See this tutorial).

Related

How to stop skipping frames [duplicate]

I am new to Android SDK/API environment. It's the first I am trying to draw a plot/chart. I tried running different kinds of sample codes on the emulator using 3 different free libraries, nothing is showing on the layout screen. The logcat is repeating the following message:
W/Trace(1378): Unexpected value from nativeGetEnabledTags: 0
I/Choreographer(1378): Skipped 55 frames! The application may be doing too much work on its main thread.
The problem didn't persist and the chart worked when I ran a sample code pertaining to an evaluation copy of a licensed library.
taken from : Android UI : Fixing skipped frames
Anyone who begins developing android application sees this message on
logcat “Choreographer(abc): Skipped xx frames! The application may be
doing too much work on its main thread.” So what does it actually
means, why should you be concerned and how to solve it.
What this means is that your code is taking long to process and frames
are being skipped because of it, It maybe because of some heavy
processing that you are doing at the heart of your application or DB
access or any other thing which causes the thread to stop for a while.
Here is a more detailed explanation:
Choreographer lets apps to connect themselves to the vsync, and
properly time things to improve performance.
Android view animations internally uses Choreographer for the same
purpose: to properly time the animations and possibly improve
performance.
Since Choreographer is told about every vsync events, I can tell if
one of the Runnables passed along by the Choreographer.post* apis
doesnt finish in one frame’s time, causing frames to be skipped.
In my understanding Choreographer can only detect the frame skipping.
It has no way of telling why this happens.
The message “The application may be doing too much work on its main
thread.” could be misleading.
source :
Meaning of Choreographer messages in Logcat
Why you should be concerned
When this message pops up on android
emulator and the number of frames skipped are fairly small (<100) then
you can take a safe bet of the emulator being slow – which happens
almost all the times. But if the number of frames skipped and large
and in the order of 300+ then there can be some serious trouble with
your code. Android devices come in a vast array of hardware unlike ios
and windows devices. The RAM and CPU varies and if you want a
reasonable performance and user experience on all the devices then you
need to fix this thing. When frames are skipped the UI is slow and
laggy, which is not a desirable user experience.
How to fix it
Fixing this requires identifying nodes where there is or
possibly can happen long duration of processing. The best way is to do
all the processing no matter how small or big in a thread separate
from main UI thread. So be it accessing data form SQLite Database or
doing some hardcore maths or simply sorting an array – Do it in a
different thread
Now there is a catch here, You will create a new Thread for doing
these operations and when you run your application, it will crash
saying “Only the original thread that created a view hierarchy can
touch its views“. You need to know this fact that UI in android can be
changed by the main thread or the UI thread only. Any other thread
which attempts to do so, fails and crashes with this error. What you
need to do is create a new Runnable inside runOnUiThread and inside
this runnable you should do all the operations involving the UI. Find
an example here.
So we have Thread and Runnable for processing data out of main Thread,
what else? There is AsyncTask in android which enables doing long time
processes on the UI thread. This is the most useful when you
applications are data driven or web api driven or use complex UI’s
like those build using Canvas. The power of AsyncTask is that is
allows doing things in background and once you are done doing the
processing, you can simply do the required actions on UI without
causing any lagging effect. This is possible because the AsyncTask
derives itself from Activity’s UI thread – all the operations you do
on UI via AsyncTask are done is a different thread from the main UI
thread, No hindrance to user interaction.
So this is what you need to know for making smooth android
applications and as far I know every beginner gets this message on his
console.
As others answered above, "Skipped 55 frames!" means some heavy processing is in your application.
For my case, there is no heavy process in my application. I double and triple checked everything and removed those process I think was a bit heavy.
I removed Fragments, Activities, Libraries until only the skeleton was left. But still the problem did not go away. I decided to check the resources and found some icons and background I use are pretty big as I forgot to check the size of those resources.
So, my suggestion is if none of the above answers help, you may also check your resource files size.
I too had the same problem.
Mine was a case where i was using a background image which was in drawables.That particular image was of approx 130kB and was used during splash screen and home page in my android app.
Solution - I just shifted that particular image to drawables-xxx folder from drawables and was able free a lot of memory occupied in background and the skipping frames were no longer skipping.
Update Use 'nodp' drawable resource folder for storing background drawables
files.
Will a density qualified drawable folder or drawable-nodpi take precedence?
Another common cause of delays on UI thread is SharedPreferences access. When you call a PreferenceManager.getSharedPreferences and other similar methods for the first time, the associated .xml file is immediately loaded and parsed in the same thread.
One of good ways to combat this issue is triggering first SharedPreference load from the background thread, started as early as possible (e.g. from onCreate of your Application class). This way the preference object may be already constructed by the time you'd want to use it.
Unfortunately, sometimes reading a preference files is necessary during early phases of startup (e.g. in the initial Activity or even Application itself). In such cases it is still possible to avoid stalling UI by using MessageQueue.IdleHandler. Do everything else you need to perform on the main thread, then install the IdleHandler to execute code once your Activity have been fully drawn. In that Runnable you should be able to access SharedPreferences without delaying too many drawing operations and making Choreographer unhappy.
I had the same problem. Android Emulator worked perfectly on Android < 6.0. When I used emulator Nexus 5 (Android 6.0), the app worked very slow with I/Choreographer: Skipped frames in the logs.
So, I solved this problem by changing in Manifest file hardwareAccelerated option to true like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication">
<application android:hardwareAccelerated="true">
...
</application>
</manifest>
Update Jan 2022. According to the comment from #M.Ed: Hardware acceleration is enabled by default if you're targeting APIs >= 14.
Try to use the following strategies in order to improve your app performance:
Use multi-threading programming if possible. The performance benefits are huge, even if your smart phone has one core (threads can run in different cores, if the processor has two or more). It's useful to make your app logic separated from the UI. Use Java threads, AsyncTask or IntentService. Check this.
Read and follow the misc performance tips of Android development website. Check here.
I am not an expert, but I got this debug message when I wanted to send data from my android application to a web server. Though I used AsyncTask class and did the data transfer in background, for getting the result data back from server I used get() method of the AsyncTask class which makes the UI synchronous which means that your UI will be waiting for too long. So my advice is to make your app do every network oriented tasks on a separate thread.
I had the same problem. In my case I had 2 nested Relative Layouts. RelativeLayout always has to do two measure passes. If you nest RelativeLayouts, you get an exponential measurement algorithm.
Optimize your images ... Dont use images larger than 100KB ... Image loading takes too much CPU and cause your app hangs .
this usually happens when you are executing huge processes in main thread. it's OK to skip frames less than 200. but if you have more than 200 skipped frames, it can slow down your application UI thread. what you can do is to do these processes in a new thread called worker thread and after that, when you want to access and do something with UI thread(ex: do something with views, findView etc...) you can use handler or runOnUiThread(I like this more) in order to display the processing results.
this absolutely solves the problem. using worker threads are very useful or even must be used when it comes to this cases.
https://stacklearn.ir
I had the same problem. When I ran the code on another computer, it worked fine. On mine, however, it displayed "The application may be doing too much work on its main thread".
I solved my problem by restarting Android studio [File -> Invalidated caches / Restart -> click on "Invalidate and Restart"].
My app had same problem. But it was not doing other than displaying list of cards and text on it. Nothing running in background. But then after some investigation found that the image set for card background was causing this, even though it was small(350kb). Then I converted the image to 9patch images using
http://romannurik.github.io/AndroidAssetStudio/index.html.
This worked for me.
In my case, it was because I had accidentally set a breakpoint on a method. Once I cleared it, the message went away and performance improved a lot.
As I did first preferably use SVG images instead of all other types, If not possible compress all of your PNG and JPG resources using some image processing tools such as Adobe Photoshop or Fotosizer. one of the easiest ways is online image compressing tools like this which helped me to decrease all my image files to almost 50% of their initial size.
This is actually not a problem. This happens when you have the debugger for a long time. Remove the brake point and check again.
I got same issue while developing an app which uses a lot of drawable png files on grid layout. I also tried to optimize my code as far as possible.. but it didn't work out for me.. Then i tried to reduce the size of those png.. and guess its working absolutely fine.. So my suggestion is to reduce size of drawable resources if any..
After doing much R&D on this issue I got the Solution,
In my case I am using Service that will run every 2 second and with the runonUIThread, I was wondering the problem was there but not at all.
The next issue that I found is that I am using large Image in may App and thats the problem.
I removed the Images and set new Images.
Conclusion :- Look into your code is there any raw file that you are using is of big size.
First read the warning. It says more load on main thread. So what you have to do is just run functions with more work in a thread.
Have not resolved yet but will do. For my tiny project with one composable function (button) and logic to check if "com.whatsapp" packages exists on device (emulator) i have the following in the same log while starting simulator:
I/Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread.
For me that was RoundedBackgroundColorSpan ! in textview, I remove it so (burn my brain to find it because It doesn't appear in real smartphones like Pixel 4 Xl or Samsung note 10+ also in emulator but in chip device this slow a view).
This is normal if you are using async/await functionalities in your application.

Skipping frames after preparing jsoup connect [duplicate]

I am new to Android SDK/API environment. It's the first I am trying to draw a plot/chart. I tried running different kinds of sample codes on the emulator using 3 different free libraries, nothing is showing on the layout screen. The logcat is repeating the following message:
W/Trace(1378): Unexpected value from nativeGetEnabledTags: 0
I/Choreographer(1378): Skipped 55 frames! The application may be doing too much work on its main thread.
The problem didn't persist and the chart worked when I ran a sample code pertaining to an evaluation copy of a licensed library.
taken from : Android UI : Fixing skipped frames
Anyone who begins developing android application sees this message on
logcat “Choreographer(abc): Skipped xx frames! The application may be
doing too much work on its main thread.” So what does it actually
means, why should you be concerned and how to solve it.
What this means is that your code is taking long to process and frames
are being skipped because of it, It maybe because of some heavy
processing that you are doing at the heart of your application or DB
access or any other thing which causes the thread to stop for a while.
Here is a more detailed explanation:
Choreographer lets apps to connect themselves to the vsync, and
properly time things to improve performance.
Android view animations internally uses Choreographer for the same
purpose: to properly time the animations and possibly improve
performance.
Since Choreographer is told about every vsync events, I can tell if
one of the Runnables passed along by the Choreographer.post* apis
doesnt finish in one frame’s time, causing frames to be skipped.
In my understanding Choreographer can only detect the frame skipping.
It has no way of telling why this happens.
The message “The application may be doing too much work on its main
thread.” could be misleading.
source :
Meaning of Choreographer messages in Logcat
Why you should be concerned
When this message pops up on android
emulator and the number of frames skipped are fairly small (<100) then
you can take a safe bet of the emulator being slow – which happens
almost all the times. But if the number of frames skipped and large
and in the order of 300+ then there can be some serious trouble with
your code. Android devices come in a vast array of hardware unlike ios
and windows devices. The RAM and CPU varies and if you want a
reasonable performance and user experience on all the devices then you
need to fix this thing. When frames are skipped the UI is slow and
laggy, which is not a desirable user experience.
How to fix it
Fixing this requires identifying nodes where there is or
possibly can happen long duration of processing. The best way is to do
all the processing no matter how small or big in a thread separate
from main UI thread. So be it accessing data form SQLite Database or
doing some hardcore maths or simply sorting an array – Do it in a
different thread
Now there is a catch here, You will create a new Thread for doing
these operations and when you run your application, it will crash
saying “Only the original thread that created a view hierarchy can
touch its views“. You need to know this fact that UI in android can be
changed by the main thread or the UI thread only. Any other thread
which attempts to do so, fails and crashes with this error. What you
need to do is create a new Runnable inside runOnUiThread and inside
this runnable you should do all the operations involving the UI. Find
an example here.
So we have Thread and Runnable for processing data out of main Thread,
what else? There is AsyncTask in android which enables doing long time
processes on the UI thread. This is the most useful when you
applications are data driven or web api driven or use complex UI’s
like those build using Canvas. The power of AsyncTask is that is
allows doing things in background and once you are done doing the
processing, you can simply do the required actions on UI without
causing any lagging effect. This is possible because the AsyncTask
derives itself from Activity’s UI thread – all the operations you do
on UI via AsyncTask are done is a different thread from the main UI
thread, No hindrance to user interaction.
So this is what you need to know for making smooth android
applications and as far I know every beginner gets this message on his
console.
As others answered above, "Skipped 55 frames!" means some heavy processing is in your application.
For my case, there is no heavy process in my application. I double and triple checked everything and removed those process I think was a bit heavy.
I removed Fragments, Activities, Libraries until only the skeleton was left. But still the problem did not go away. I decided to check the resources and found some icons and background I use are pretty big as I forgot to check the size of those resources.
So, my suggestion is if none of the above answers help, you may also check your resource files size.
I too had the same problem.
Mine was a case where i was using a background image which was in drawables.That particular image was of approx 130kB and was used during splash screen and home page in my android app.
Solution - I just shifted that particular image to drawables-xxx folder from drawables and was able free a lot of memory occupied in background and the skipping frames were no longer skipping.
Update Use 'nodp' drawable resource folder for storing background drawables
files.
Will a density qualified drawable folder or drawable-nodpi take precedence?
Another common cause of delays on UI thread is SharedPreferences access. When you call a PreferenceManager.getSharedPreferences and other similar methods for the first time, the associated .xml file is immediately loaded and parsed in the same thread.
One of good ways to combat this issue is triggering first SharedPreference load from the background thread, started as early as possible (e.g. from onCreate of your Application class). This way the preference object may be already constructed by the time you'd want to use it.
Unfortunately, sometimes reading a preference files is necessary during early phases of startup (e.g. in the initial Activity or even Application itself). In such cases it is still possible to avoid stalling UI by using MessageQueue.IdleHandler. Do everything else you need to perform on the main thread, then install the IdleHandler to execute code once your Activity have been fully drawn. In that Runnable you should be able to access SharedPreferences without delaying too many drawing operations and making Choreographer unhappy.
I had the same problem. Android Emulator worked perfectly on Android < 6.0. When I used emulator Nexus 5 (Android 6.0), the app worked very slow with I/Choreographer: Skipped frames in the logs.
So, I solved this problem by changing in Manifest file hardwareAccelerated option to true like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication">
<application android:hardwareAccelerated="true">
...
</application>
</manifest>
Update Jan 2022. According to the comment from #M.Ed: Hardware acceleration is enabled by default if you're targeting APIs >= 14.
Try to use the following strategies in order to improve your app performance:
Use multi-threading programming if possible. The performance benefits are huge, even if your smart phone has one core (threads can run in different cores, if the processor has two or more). It's useful to make your app logic separated from the UI. Use Java threads, AsyncTask or IntentService. Check this.
Read and follow the misc performance tips of Android development website. Check here.
I am not an expert, but I got this debug message when I wanted to send data from my android application to a web server. Though I used AsyncTask class and did the data transfer in background, for getting the result data back from server I used get() method of the AsyncTask class which makes the UI synchronous which means that your UI will be waiting for too long. So my advice is to make your app do every network oriented tasks on a separate thread.
I had the same problem. In my case I had 2 nested Relative Layouts. RelativeLayout always has to do two measure passes. If you nest RelativeLayouts, you get an exponential measurement algorithm.
Optimize your images ... Dont use images larger than 100KB ... Image loading takes too much CPU and cause your app hangs .
this usually happens when you are executing huge processes in main thread. it's OK to skip frames less than 200. but if you have more than 200 skipped frames, it can slow down your application UI thread. what you can do is to do these processes in a new thread called worker thread and after that, when you want to access and do something with UI thread(ex: do something with views, findView etc...) you can use handler or runOnUiThread(I like this more) in order to display the processing results.
this absolutely solves the problem. using worker threads are very useful or even must be used when it comes to this cases.
https://stacklearn.ir
I had the same problem. When I ran the code on another computer, it worked fine. On mine, however, it displayed "The application may be doing too much work on its main thread".
I solved my problem by restarting Android studio [File -> Invalidated caches / Restart -> click on "Invalidate and Restart"].
My app had same problem. But it was not doing other than displaying list of cards and text on it. Nothing running in background. But then after some investigation found that the image set for card background was causing this, even though it was small(350kb). Then I converted the image to 9patch images using
http://romannurik.github.io/AndroidAssetStudio/index.html.
This worked for me.
In my case, it was because I had accidentally set a breakpoint on a method. Once I cleared it, the message went away and performance improved a lot.
As I did first preferably use SVG images instead of all other types, If not possible compress all of your PNG and JPG resources using some image processing tools such as Adobe Photoshop or Fotosizer. one of the easiest ways is online image compressing tools like this which helped me to decrease all my image files to almost 50% of their initial size.
This is actually not a problem. This happens when you have the debugger for a long time. Remove the brake point and check again.
I got same issue while developing an app which uses a lot of drawable png files on grid layout. I also tried to optimize my code as far as possible.. but it didn't work out for me.. Then i tried to reduce the size of those png.. and guess its working absolutely fine.. So my suggestion is to reduce size of drawable resources if any..
After doing much R&D on this issue I got the Solution,
In my case I am using Service that will run every 2 second and with the runonUIThread, I was wondering the problem was there but not at all.
The next issue that I found is that I am using large Image in may App and thats the problem.
I removed the Images and set new Images.
Conclusion :- Look into your code is there any raw file that you are using is of big size.
First read the warning. It says more load on main thread. So what you have to do is just run functions with more work in a thread.
Have not resolved yet but will do. For my tiny project with one composable function (button) and logic to check if "com.whatsapp" packages exists on device (emulator) i have the following in the same log while starting simulator:
I/Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread.
For me that was RoundedBackgroundColorSpan ! in textview, I remove it so (burn my brain to find it because It doesn't appear in real smartphones like Pixel 4 Xl or Samsung note 10+ also in emulator but in chip device this slow a view).
This is normal if you are using async/await functionalities in your application.

Rendering an Android XML layout in Java

I'm building a Java application that is some sort of Android applications (APK files) analyzer.
One of the main features that the app will offer is a "preview" of an Android layout, hence I need an API that receives an Android layout XML and a few configuration arguments such as screen resolution and theme, and returns the rendered layout as it would appear on a device running the application (graphical consistency with the real Android platform is important) along with position data of the View objects (in order to allow the user to select a view by clicking it). At the first stage, I don't expect the feature to reflect layout changes that are made programmatically, but only the View objects and resource graphics defined in the XML.
The idea I have in mind is to use the source code of a layout editor, such as ADT's editor or DroidDraw, and integrate it into my framework, but then I was wondering - maybe a better way would be to use the android API itself to render the layout for me (this is better mainly because I won't need to rewrite my code for later versions of the OS).
So my question is: does the API allows such operations? Or is there an even better way?
Any suggestions and insights are welcomed :)
does the API allows such operations?
If by "java application" you mean an app that runs on your PC, then no. There's no straightforward way to even call anything in the Android API. I'd recommend you go with the first approach of integrating some existing source code.
That said, this is not a straightforward task either. Also, if you're analyzing an APK, you'll be working with binary XML files, not the easy-to-read plain text ones that you see when developing (which assumedly are what ADT/DroidDraw use). There may be source code out there to deal with that too.
You could also consider looking at the source for Android itself, but I imagine you'd have to re-implement a bunch of rendering code, so that's no easy way out either.
At the first stage, I don't expect the feature to reflect layout changes that are made programmatically, but only the View objects and resource graphics defined in the XML.
Reflecting the layout changes made programmatically will be virtually impossible to do in a reasonable way.
This task is definitely possible, however, it's not straightforward at all. I would suggest taking a look and Android Studio's source code, more specifically there is a tool called LayoutLib.
This is the tool that the IDE's layout preview/editor uses to render layouts. You can use this to render layouts and views that you have the source code for. Unfortunately, it's not very well documented, so you have to figure out the usage from IDE's sources.
The open source Itsnat has a way to render loaded XML Android Layout files directly. it has a sample app that compares the standard (binary compiled) versions with the dynamic. My work with it shows that it does a good job reproducing all the quirks of LinearLayout/Relativelayout, etc. https://github.com/jmarranz/itsnat

Scrolling via SmartWatch control

I very much like the look and feel of Sony's extensions for the SmartWatch that have the scrolling functionality, and I would like to have the same thing in my apps. Is there any example or guideline how to implement this?
It would be nice if such functionality were a part of the Utils lib, as I see no need to waste time and brainpower to implement something that every programmer today takes for granted. I would rather focus on some unique features I'd like to develop.
Thanks for the help!
The scrolling functionality that you refer to is implemented in the firmware of the SmartWatch, and is only applicable for the Notification extensions. Due to limitations of the watch hardware, this cannot currently be applied to the Control extensions.
FWIW I've found I can simulate scrollable text by rendering the text into a bitmap in memory, and then displaying a list of bitmaps, each of which is a chunk extracted from the bitmap.
http://damianblog.com/2014/01/12/sw2-scrollable-text/
Was not possible with the SmartWatch 1, but can be achieved through lists and galleries in SmartWatch 2. That is the only way, so far.

Design a GUI for a J2ME app

How do I create a J2ME app for cellphones with a GUI similar to the menus you see in Java games? I've tried MIDlets with Netbeans but they only show you one GUI element at a time. (textbox, choice, login, etc)
And which Java IDE would you typically design these GUIs in? Netbeans or Eclipse? and is IntelliJ IDEA usable for this aswell?
Do I have to write/get a library that draws GUI controls to screen via bitmap functions .. and keeps track of the keys pressed for focus?
Try to use LWUIT - nice UI toolkit for j2me:
https://lwuit.dev.java.net/
http://lwuit.blogspot.com/
You can also use minime: http://code.google.com/p/minime/
It's an open source GUI library for j2me. miniME works on canvas level (lowest level in j2me) to draw every control so your UI will look exactly the same whatever the handset it'll be running on. Other advantage are:
- miniME uses its own event loop to manage user controlled event (botton pressed, softbar, ..), so you Application will "behave" the same whatever the handset.
- miniME support the concept of Views and stack of view, in order to make navigation between different view/screens very easy.
Here is an example: A View is what you have on the screen at a given moment (for example the main menu screen), then to go to a sub menu, you create a new view, and by calling a simple API, you push it in the stack of Views. The previous view (the main menu) is still existing, but inactive. When the sub menu view complete his work (for example, user press back, or do a selection), you can just go back to the previous view by calling a pop api.
Your question is a bit vague to give a specific aswer, but you might want to check out LWUIT or Polish, you can develop both with either Eclipse or Netbeans.
As far as designing GUIs go, neither IDE will help from a visual perspective. J2ME UI development is all done in code, beyond creating any initial graphics in a proper graphics editor you don't get to see your output until you test.
Read up on the LCDUI package documentation which explains how the UI classes work and the differences between the 'High-level' and 'low-level' APIs.
I can't comment on which IDE to use - but I do know that to create custom UI (like the ones you see in J2ME games), you have to explicitly draw the GUI controls.
Beware that you may need to customize the GUI depending on the target phones. You have to cater for different screen sizes, key pad configurations, default theme etc. This would probably mean that you need different builds for things like different screen sizes which would drive up your Java Verified certification costs (if you need it).
You may be able to find a set of nice looking UI controls that you can buy online and use (try J2ME Polish). The easy way out of course, is to use default J2ME controls :)
Links to many j2me GUI libraries: link1, link2
I know that kuix is not bad and free - watch demo.
But i prefer to make my own gui elements - this is much more flexible (but takes some time).
As for IDE - you may want to make some kind of gui-editor tool, construct interface in it, save result to some file, and read it from your app.
It's way too cumbersome to write your own GUI, especially since there are so many available these days. If you're familiar with desktop development in VB.Net and C#, you might find "J2ME GUI" easy to use. You can download it from http://www.garcer.com/. It has a similar feel and makes it easy to learn. This is the kind of GUI that I expected to come standard with MIDP2 when I started mobile development. Would have solved a lot of issues.
If you are familiar with web stuffs then you can use KUIX (kalmeo.org/home/index) framework having xml and css supports. In place of It you can use also Polish framework (www.j2mepolish.org) it's also uses the xml in easy way rather than kalmeo kuix framework.

Categories