How to make my application to sing instead of the iPod when it's
in the background. I think that I need to do my NSURL to MPMediaItem
and play with iPodMusicPlayer. How can I do this?
Related
I'm developing (or trying to) a J2ME application. I need to be able to handle onKeyEvents (keyDown/keyPressed/keyUp...) in TextEdit/TextBoxes, but I've learned that such thing is not possible in J2me, at least not in a simple way as in Java/Android development (myEdit.setOnKeyListener() for example). I've read something about using Canvas, but I'm not sure how can I use that to make it work for me.
Answer to this question ( Image in button - j2me ) involves using the CustomItem class and make an item look/act like a Button. Is there anyway to use the same approach?
The TextBox and TextField objects are high-level GUI stuff, available when doing javax.microedition.lcdui.Form stuff.
In order to use keyPressed() and keyReleased() you must use javax.microedition.lcdui.Canvas (low-level GUI stuff).
But what you're probably really after, is LWUIT (https://lwuit.java.net). It is a framework built on javax.microedition.lcdui.Canvas which gives you a Form-like API with all the things javax.microedition.lcdui.Form is missing.
I am using this line of code to start the Video Component:
videoComponent = VideoComponent.createVideoPeer("capture://video");
The code I have works perfectly on a Nokia phone but I have another phone by OLG and this line always fails. Both "capture://video" and "capture://image" don't work.
Does anyone know how to find out whats the proper string to put there or all the possibilities?
I would search it but I don't know what to type into Google.
VideoComponent in LWUIT 1.5 had many bugs and since LWUIT is effectively abandoned it will probably never be fixed and never really worked well. With Codename One we migrated to a more traditional Media approach, I would recommend migrating to Codename One.
I'm developing an App with some maps functionalities (among other things), I'd like to draw a map from my current location to a given destination, but I do not want to use the shareadapplication, The shared application does not have a BACK button for example and some other navigation items I already have.
I want to do it in my own viewcontroller with mkmapview on it.
I already have the code to place the pin annotations, what I need is to trace the driving directions from A to B.
The other option is to use the [[UIApplication sharedApplication] openURL:url] call to appear inside the viewcontroller window so I can keep my navigation items.
Any ideas?
thnxs
You can't do the "other option". iOS apps do not run inside windows that you can put within your app, they are full screen apps and you can make you app switch to them, but you can't make other apps switch back to yours.
So, the big question is, where are you going to get driving directions from? Check out GoogleMapsSDK, OpenStreetMap and CloudMade, because iOS maps won't give you the directions.
I am new to j2me. I am developing a mobile application in j2me. Is there a way of adding a canvas object to the background of a form? I tried searching in net with few people suggesting to use "jmepolish". I have no idea what jmepolish is..Is there a way to do this with normal j2me classes?
No there's no way to do this. A J2ME form has very limited levels of customisation.
In order to make a fancy looking form that looks exactly as you want, you need to use the Canvas class; this involves doing everything else yourself, i.e. drawing your own input widgets, managing your own user interaction, including scrolling, and any touch screen/gesture stuff if your device supports it.
You can use libraries like J2ME Polish that will do that for you, but even then you will be constrained by what that library supports; and there is an overhead for including the library in your midlet.
Currently, I have some basic code to play a simple tone whenever a button is pressed in the command item menu.
Using: Manager.playTone(note, duration, volume);
I also have a blackberry that I'm testing this same midlet on and the sound works fine. So, is this something specific to Nokia phones that aren't allowing me to play the sound?
I've made sure to build it using the correct CLDC and MIDP versions.
I've also tried the audio demos that are in the Netbeans IDE, and still no luck. It throws a "cannot create player" message.
http://discussion.forum.nokia.com/forum/showthread.php?t=91500
This thread on Forum Nokia seems to suggest that certain Nokia models have problems playing tones with the Manager.playTone() function, more specifically a MediaException is thrown, as you are having (MediaException is just the default exception if any problem occurs when trying to play a tone).
You can try sleeping the thread after calling Manager.playTone for greater than the length of the tone. There is a possibility that you get into a state where you are trying to play two or more tones at once and the phone might not allow more than one player to be created at a time.
If all else fails you can use the Nokia UI Sound class (com.nokia.mid.sound.Sound) to play the tone. It is deprecated and replaced with the call you are making, but it might be your only solution for this device. Just make your own playTone method and have it call the Nokia function for this device (and maybe other Nokia devices if need be) and the J2ME standard call on all other devices. You can accomplish this with the Netbeans ME Preprocessor.
http://www.theoreticlabs.com/dev/api/nokia-ui-1.1/com/nokia/mid/sound/Sound.html