how can get name of current city in nokia asha java ME - java-me

I am working on nokia asha sdk1.1 with using lwuit 1.5.so i want to get the name of current city where user running the app so how i can get it in nokia asha java ME

The phone needs to get this information from somewhere.
So you need to get the current location, and then do something called "reverse geocoding" to get the city for this location.
The nokia developer guide about location may help you:
http://developer.nokia.com/resources/library/Java/developers-guides/location-services.html

Related

Nokia Asha SDK Background Tasks

I have a problem in background processing I am working on app which needs to run tasks periodically to update content or download some files. I tried PushRegistery, but it launches UI (My App Midlet) however this tasks doesn't need to UI.
Simply I need to use something like Android Background Service and IntentService. Is that supported in Nokia Asha SDK or not and if not I am asking if there is a workaround to do that.
Also I every time app launched permissions prompted to use. How can I prevent that ?
I am working on device Nokia Asha 501
Standard JavaME doesn't offer any way of making background MIDlets.
But some phones lets you do Display.setCurrent(null); in order to hide the GUI and show the phone UI instead. I've seen it work on Sony Ericsson phones, but I'm not sure if it works on Nokia devices. (I don't think so).
With the Asha models, Nokia introduced a whole set of new API's though, so maybe you can do it using one of those. I haven't been able to find any such option myself though.
As for the permission prompts, there's sadly only one way to get rid of those, and that is to sign your MIDlet with an expensive certificate, for $299 - each year...
A few phones lets you manually set the security settings though. I've seen this too on a few Sony Ericsson phones, where you can set stuff like "Only ask once" or "Never ask" for certain operations like "Camera access" and such. Don't think Nokia offers such options though.
Finally, it's possible to patch / hack the phone to kill the JavaME security. But again, I've only seen it on Sony Ericsson phones, and I don't know of any way to do it with a Nokia phone.
So I'm afraid you need to look into signing.

My app does not appear in searches on the marketplace

My app is available on the firefox marketplace at https://marketplace.firefox.com/app/shopping-list/
However if I search for "shopping" or "shopping list" in the marketplace app or on https://marketplace.firefox.com it does not appear anywhere.
What is going on ?
Your app does not appear when searching the Firefox Marketplace from Desktop or Android because we filter search results to show only apps that will work on the device you are searching from, and you did not check the boxes to say that it is available on desktop or android. Like Jason, I easily found your app when searching from my Firefox OS phone.
Gi,
Marketplace reviewer here. Your app is public and has the following requirements:
IndexedDB, Smartphone-Sized Displays (qHD), Vibration.
You should be able to find it, no matter what version you are using.
My guess is that your are using any hyphen to look for it. If you try using "shopping", it will be in the third place:

How to use local media player of Nokia Asha 311 S40 FT device

If I would like to use the local media player of Nokia S40 FT device in my application for mp3 audio. How can I do that?
have you try to use platform Request?
you can find something useful in here http://www.developer.nokia.com/Resources/Library/Java/#!developers-guides/invoking-applications/invoking-applications-in-java-me.html
I wrote this a while back:
http://indiegamemusic.com/help.php?id=1
Should be what you need.
you may use method from com.nokia.mid.impl.jms.core.Launcher:
String url = "E:\\mymp3.mp3";
Launcher.handleContent(url);
But its required manufacturer or operator domain certificate. But you may open full access for filesystem from JAVA-apps (like a Root in android).

Video player using j2me to play mp4 from a directory

I want to develop a j2me application that will play a video file(.mp4) by selecting a particular directory on mobile phone(nokia s40 series).
How do i go about this?can anyone help me to initiate the above said process.
You need to use JSR-135 and JSR-75 to accomplish this.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-B6B3EB3A-05F6-4CD4-920A-8ED818328681.html for Nokia implementation notes for JSR-75 FileConnection.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-F227753C-29F7-4056-AB46-1BD80F83E109.html for Nokia implementation notes for JSR-135 Mobile Media.
The Javadocs can be found: http://java.sun.com/javame/reference/apis/jsr135/ and http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-D69FC49D-783E-45CE-80D4-7A9F3EE08B2A/overview-summary.html .
Note that only certain directories are exposed via Java ME. You can find information on which folders under the System properties link in the JSR-75 link above.
Basically you want to do this:
Use FileConnection to open a directory and list it contents.
Let the user choose one of the files in the directory.
Create a video player via JSR-135 with the file path as input: Player player = Manager.createPlayer("path_to_the_file");
You also have to attach a VideoControl to the player that associoates a canvas/form to render the video on. (Use VideoControl.initDisplayMode). You also set all the video properties via this control, such as size, location etc.
Then use player.start() to start the playback.
This is a pretty good starting tutorial: http://today.java.net/pub/a/today/2005/09/27/j2me4.html

Does J2ME Media Player on Nokia E65 work?

I'm trying to write a simple media playback application in J2ME. Currently I'm starting with the most simple thing, I just want to play a wav file from resources included in the jar file. I'm using this simple code:
DataInputStream wav = new DataInputStream(getClass().getResourceAsStream("sample.wav"));
Player player = Manager.createPlayer(wav, "audio/x-wav");
player.addPlayerListener(this);
player.realize();
VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
if( vc != null )
vc.setLevel(100);
player.start();
I run it on two phones: Nokia E65 with latest firmware and Nokia 3110c with original firmware. On E65 I see that the player is created, it starts playing and there are no exceptions thrown. But I can hear nothing... The same wav file works fine with built in media player.
As you see I have a player listener attached and it only receives single message: STARTED. (There is no VOLUME_CHANGED or END_OF_MEDIA event.)
The same jar file running on Nokia 3110c plays fine and shows all expected player events.
Any idea what may be wrong with the E65 or what I'm doing wrong?
I've found solution at Nokia forums: Does J2ME Media Player on Nokia E65 work?
Warning Tones must be enabled in user's profile.
Make sure you have "warning sounds" switched on in the current profile...
...check the manual for the device. On the N96, it's in Tools, Profiles, (select profile), Options, Personalise, Warning Tones.
There's no way to check this setting from the j2me application code.

Resources