Nokia Asha SDK Background Tasks - java-me

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.

Related

How does Scratch play sounds without any problem on mobile?

If you are familiar with scratch, you'll know that Scratch 3 was built to support mobile.
Javascript audio isn't working on mobile devices shows that mobile doesn't support auto playback of audio
Scratch seems to play audio without a problem...
Does anyone know the secret behind Scratch mobile audio playing capabilities? (share pieces of code which scratch uses to play audio on mobile)
(Incase you're wondering why I need to know this, I need to use it on my website)
Read the answer carefully.
Some mobile browsers support automatic playback of audio, but ios, chrome and others require interactive actions to trigger the sound playback.You can try working with the mute attribute..
Scratch can't play sounds automatically. You have to click the Start button on any project. By "interactive actions" they mean clicks, scroll etc,.

Rotate screen orientation on Web App Tizen [TV]

I'm developing a Web Application on Tizen. My application was first developed on other platforms like iOS and Android.
Basically it starts on Landscape mode and plays remote content such as image, video or opens a web page. It has a menu inside the app to offer people the ability to change the screen orientation inside the app manually.
This approach is quite easy on iOS and Android but on Tizen seems it doesn't work that easy.
I'm following Tizen's official documentation which send's us to : https://w3c.github.io/screen-orientation/
But, can't make it work even though I followed steps written on the link above.
This is what I got when I try to rotate:
Trying with :
screen.orientation.lock('portrait-primary')
Error :
Promise {}
index.html:1 Uncaught (in promise) DOMException: The page needs to be fullscreen in order to call screen.orientation.lock().
P.S. The app is already in fullscreen. The error is not relevant.
Do you have any ideas ?
Thank you
For all to those who are still trying to achieve this:
After having a long discussion with Samsung, they claimed that supporting the TV orientation via code is not possible right now (Not sure if it's gonna be implemented in the future).
These restrictions come due to different operability of the hardware components on different orientation.
The only way to rotate your screen is to do it via Samsung's TV Settings so that it can prepare its hardware for the chosen orientation.
There are a special Samsung TVs for Advertising market (Digital Signage series) that are ready to set the orientation of the screen.
I comercial Samsung TV sets Tizen is not able to rotate some kind of elements (as far I know the video object are one of the HTML elements that cannot be rotated)
I've developed some apps for Tizen and for one customer I tried to make a video wall but it was impossible due the firmware limitation of Tizen (it's a marketing strategy in order to avoid having hotel and digital signage capabilities in commercial TV sets)

Why am I getting a LAUNCH_ERROR, NOT_FOUND when attempting to play to an audio-only Google Cast device?

I recently purchased a LG Music Flow H3 to test my Google Cast app with an 'audio-only' device. I've enabled audio-only device support within the Google Cast Dashboard and I've registered the device for development. My app works as expected when played to Google Chromecasts, however when attempting to load the receiver app on the LG device I get the following error:
{"reason":"NOT_FOUND","requestId":1,"type":"LAUNCH_ERROR"}
Thinking that perhaps 3rd-party devices can't be registered for development, I went ahead and published my app. Unfortunately this did not address the problem.
Upon further investigation, I'm noticing that other Google Cast apps (i.e. Songza, TuneIn, Pandora, etc. on both Android & iOS) aren't able to play to the LG Music Flow H3 either.
I discovered that the only way to get the H3 to play from Google Cast apps (both my app and others) is to first run the LG Music Flow multi-room audio app. Running the LG Music Flow app appears to effect the device's _googlecast._tcp zeroconf service discoverability. And sometimes the H3 shows up in zeroconf yet you still can't play to the speaker unless the LG Music Flow app is running.
This seams like very strange behavior. I called LG Tech Support, and they recommended I return the device and exchange it for a different one. I did this, and I still get the same result.
Is this how Google Cast on 3rd-Party devices is intended to work? Have I encountered a buggy 3rd-party implementation?
This is not the intended behavior for sure. You are supposed to be able to launch your 3rd party application on the speaker.
And it works for me.
The fact you are not able to use any other 3rd party apps (TuneIn, Pandora etc) indicate this is a some general problem and not specifically with your app.
Couple of steps I would try:
- Setup you H3 speaker on Wifi (vs Ethernet) and get the latest SW version using the Music Flow app.
Have you Factory reset the device? if you did, you will need to go through setup again. I have noticed Google Cast becomes enabled only after first complete setup.
Please try rebooting, and than try casting apps like TuneIn or Pandora and than see if this works (without using the MusicFlow app). I have noticed in the past that if some app is loaded and is behaving badly (for example uses tons of memory) it will put the speaker into a bad state that don't allow any app to work until reboot. So perhaps when you are casting your app, it gets into a bad state causing other apps to fail afterwards.
Have you made sure not to consume to much memory? avoid graphics or video?

ios4 multitasking controls & background Audio features question

I'm pretty new to IOS4 audio/multitasking and i cant find an answer on this topic:
Got a, pretty easy, two part question:
What framework works in conjunction with the ipod framework? Everyone's seen the pandora app, so the question is:
How do you get the app to notify the user that music is playing (via the purple play icon in the status bar)?
How does this become controllable via the multitasking control bar (ya know, the ones right next to the lock-aspect button)?
It's all the same process.
The play icon is added when you successfully link up your app with the remote play controls (remoteControlReceivedWithEvent). The controls are just events that are channeled to your remote control aware app.
TYPE of audio doesn't matter, as far as i know (MPAudioPlayer doesn't work in the background though).
Hope that helps the newer coders out there :)

How to create a browser window in J2ME?

How can i create a browser component in J2ME which can display web pages inside an application? Is there any API available for this ? or is this really possible ?
My experiences:
J2MEPolish has HTML browser. It costs 990EUR per app and you need to use J2MEPolish to use it. But be warned: their HTML browser has many issues, it supports forms and other advanced elements, but if you try to get something you like then rendering quality is bad (e.g. no spacing, defaults to center view etc). Free evaluation/GPL is available.
PocketLearn J2ME HTML Component - http://www.j2mehtml.com/ seems to have less features but much better rendering quality. This is not free as well, and there they do not provide any useful evaluation download or public license fee info.
J2ME cHTML browser is free and open source, but no docs (and probably no quality too)
As far as I know, the only browser written in J2ME is Opera Mini (not to get confused with Opera Mobile, which is a different thing). It runs amazingly good even on very low end phones, but most of the HTML handling is done on a special server that Opera hosts, and the client gets optimizes, preformatted, binary data to display.
Doing everything on the phone using Java might be hard or even impossible. You'd be able to code up a browser that displays very basic HTML pages, but doing it right even for more complex pages seems to be impossible on J2ME because of the limited memory and CPU.
I could imagine that some high end phones come with a custom API to embed a native browser into you Midled, but the standart J2ME definitely does not have this.
The only portable way to display a web page in the browser is with:
MIDlet.platformRequest(String URL);
On some mobile, this will terminate the J2ME application though.
The Content handling API is what you're looking for.
That's JSR 211.
Unfortunately, to do what you want, you would need to find a handset that contains an implementation of JSR211 that is both complete and correct.
That doesn't exist yet as far as I know.
The only J2ME emulator that I know that may allow you to launch a web browser window (outside of a MIDlet) is the Nokia Series60 emulator. That doesn't have a complete implementation of JSR 211.
Try this
http://sourceforge.net/projects/fire-j2me/
Unfortunatley there are no built-in components in Java ME to render html.
You can try htmlBrowser component of the j2mePolish toolkit (www.j2mepolish.org)

Resources