Unable To Start Opera Mini With The Given URL - blackberry

I am using the following code to start the Opera Mini web browser with the given URL;
try {
ApplicationManager.getApplicationManager().launch("operette$2dhifi?" + url);
} catch (ApplicationManagerException e) {
updateInfo(e.toString());
}
But its throwing
ApplicationManagerException: module not found.
When I try without the URL
ApplicationManager.getApplicationManager().launch("operette$2dhifi");
, Opera starts fine. But I don't want to start the blank browser, I want to start it with my URL.
Looked at the BlackBerry forum and googled it also but unable to find the solution. Please guide me in the right direction.
I am developing on
BlackBerry Eclipse JDE 1.5.0
BlackBerry Bold 9900

Related

whats the current state of navigator.mediaDevices.getUserMedia for audio on IOS

I know this has been asked before but those answers are a little dated and Apple keeps changing things. I have an PWA app that runs fine on mac (safari , chrome),windows (Chrome, edge), android (chrome, edge). But does not work on ios safari or chrome
I am testing on an IPad running ios 15.4
not sure which of navigator.mediaDevices.GetUserMedia, navigator.getUserMedia, navigator.webKitGetUSerMedia... is supposed to work
do I need to be served from HTTPS?
does audioWorklet work on any IOS browser (I can work without this, but prefer to use it)
OK well I now know a lot more about this so will add my own answer. This is microphone input
AudioWorklet works on current safari on IOS but there are many oddities to be aware of
console.log from the worklet is not reported by web inspector. So I ended up writing log messages to the worklet's messageport and logging them in the code that started the worklet
many audio examples do a lot of juggling to try to locate the 'getUserMedia' function. Safari will only work if is called like this
navigator.mediaDevices.getUserMedia
If you do
getUserMedia = navigator.mediaDevices.getUserMEdia || .... || .... ;
getUserMedia(....)
Safari will throw complaining that that function must be called a child of mediaDevices
The size of the inputs array spontaneously changes after 100 or so samples for no apparent reason. Starts out with inputs[0][0] and inputs[0][1]. Ie stereo input left and right. After 100 or so samples it suddenly only has inputs[0][0], ie mono.
the reporting of exceptions in the worklet in non existant, everything just silently fails.
async await code does not try catch properly
Ie this code
async foo(){
try{
..
await xxx();
...
catch(e){
log(e);
}
}
does not catch an exception thrown by xxx

How can a Developer Hand Over a Web Request to a Native iOS Application without displaying an error if the application is not installed?

So, we've all pretty much seen it. I tap a google plus link in Safari and it opens in the native Google Plus app. If the app is not installed, it takes me to the store to download it. It's a seamless transition.
As a developer, I would like this type of integration with my web application and native application. I've seen a way to call the native app using a custom url scheme, but this throws a nasty alert if the app isn't on the device.
I thought that the way around it might be creating a Safari extension, but that's not do-able with mobile safari.
How can I achieve this seamless transition effect?
This answer might help you to determine whether the app was installed or not from web app.
iPhone browser: Checking if iPhone app is installed from browser
If it's not installed you can continue redirecting to your web app instead of myapp://
The code from one of our web apps
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
var messageContainer=$("#message");
if(!iOS)
{
messageContainer.html("Please open the link in your Apple mobile device")
}
else
{
setTimeout(function () {
messageContainer.html("Please install the app");}, 25);
window.location.href = "myapp://someInfo";
}

HTML5 web app not caching when added to home screen in iOS

To be clear, the web app IS caching and is working fine offline in Mobile Safari.
The problem is when it is added to the home screen on an iPhone 4s and iPad 2, both running iOS 6.0.1. It won't work offline and gives a network error to connect to the internet i.e. "Cannot open MYWEBAPP. MYWEBAPP could not be opened because it is not connected to the internet"
I've been debugging this for several hours and can't seem to find a solution. I'm not receiving any errors in the console and I'm running Jonathan Stark's debugging code
I've tested the app in desktop Safari, Chrome and Firefox's developer tools both Online/Offline. As well as Web Inspector with the devices in Safari. The result is the same on either iPhone or iPad. They will both cache the web app and will work in Mobile Safari, but not when added to the home screen. No errors either offline or online.
As far as I know, I'm using best practices:
Added HTML header: <html manifest="photo.appcache">
I've also experimented with using different names for the manifest file including: cache.manifest and offline.manifest as I read that it makes a difference, but in my testing it does not matter what the name is as long as the extensions are .manifest or .appcache and is served appropriately in the .htaccess file.
Added correct MIME types: AddType text/cache-manifest appcache manifest
I've also tried: AddType text/cache.manifest manifest,
AddType text/cache.manifest .manifest manifest, AddType text/cache-manifest .manifest
I don't believe this worked: AddType text/cache.manifest but I don't remember. For the most part it didn't matter and I stuck with:
AddType text/cache-manifest appcache manifest
as that what was in the HTML5 Mobile Boilerplate.
Added:
NETWORK:
*
to the appcache file. I believe this allows everything to be downloaded as well as making all links work.
I've tried removing this line: <meta name="apple-mobile-web-app-capable" content="yes">
because I read here on SO that is solved a problem similar to mine, but I can confirm that it does not work in my testing. Removing this line or setting the content to "no" when pressing on the home screen icon will redirect to Mobile Safari and not open fullscreen.
I've pretty much narrowed it down to it being a bug in iOS 6 (I'm actually using iOS 6.0.1), because I know that data has now been separated for web apps in the browser and those added to the home screen. I'm posting this issue here to see if any other developers have encountered the same issue.
I've solved this issue. I recommend the following for home screen web apps in iOS 6.
For testing purposes, use the Web Inspector and a nice JS script like Jonathan Stark's to know when the app has been cached in Mobile Safari:
http://jonathanstark.com/blog/debugging-html-5-offline-application-cache?filename=2009/09/27/debugging-html-5-offline-application-cache/
After it has been successfully cached, add the app to your home screen and leave it open in order for it to cache the home screen version separately. It has to fully cache in order for it to work offline.
Since my app cache is 22mb of data and the caching of the data is SEPARATE for the web app, the problem I had was not leaving the home screen app open long enough to cache.
This is terrible as far as user experience goes, but also good that the data is separate. I can confirm this because if you delete the website data from Safari, the home screen web app will still function.
As far as I know, there isn't a way to debug the data cached for the home screen web app, or where it is stored.
The answer above was very helpful. #aul said he didn't know of a way to debug the home screen web app but I found a way.
Hook your iPad or iPhone up to your computer, then in Safari go to Develop > and select your device. Your homescreen app must be open in order for it to appear in the drop down menu. Once you access the app, you can open up the error console and watch Jonathan Stark's script go to work. Once the manifest is downloaded, you will be able to use the app in offline mode.
This script made the life easier! Thanks to #Paul!
var cacheStatusValues = [];
cacheStatusValues[0] = 'uncached';
cacheStatusValues[1] = 'idle';
cacheStatusValues[2] = 'checking';
cacheStatusValues[3] = 'downloading';
cacheStatusValues[4] = 'updateready';
cacheStatusValues[5] = 'obsolete';
var cache = window.applicationCache;
cache.addEventListener('cached', logEvent, false);
cache.addEventListener('checking', logEvent, false);
cache.addEventListener('downloading', logEvent, false);
cache.addEventListener('error', logEvent, false);
cache.addEventListener('noupdate', logEvent, false);
cache.addEventListener('obsolete', logEvent, false);
cache.addEventListener('progress', logEvent, false);
cache.addEventListener('updateready', logEvent, false);
function logEvent(e) {
var online, status, type, message;
online = (navigator.onLine) ? 'yes' : 'no';
status = cacheStatusValues[cache.status];
type = e.type;
message = 'online: ' + online;
message+= ', event: ' + type;
message+= ', status: ' + status;
if (type == 'error' && navigator.onLine) {
message+= ' (prolly a syntax error in manifest)';
}
console.log(message);
}
window.applicationCache.addEventListener(
'updateready',
function(){
window.applicationCache.swapCache();
console.log('swap cache has been called');
},
false
);
setInterval(function(){cache.update()}, 10000);
I had a two part problem. I was generating my cache manifest with ASP.NET MVC/Razor because I wanted to be able to easily host the site off a virtual application and still have the paths line up. The content type wasn't getting set properly on the cache manifest, so Internet Explorer and Safari (iOS) weren't recognizing it (even though Chrome on PC and Android would).
Once I solved that problem, it still wasn't working when I tried to access my Azure hosted app with iOS Safari. When I tried to access with Internet Explorer, I saw that it didn't have the correct mime type for a font I was having.
So a word of warning: be absolutely sure of the mime type of not only the manifest, but also all files that the manifest depends on.

display URL in blackberry application

i have blackberry application and i try to display html text in a browser
i try
BrowserSession bSession = Browser.getDefaultSession();
bSession.displayPage("http://www.blackberry.com");
this page success but it display page in blackberry browser not in my own browser, and i don't need that
than i try
myBrowserField = new BrowserField();
add(myBrowserField);
myBrowserField.requestContent("http://www.blackberry.com");
this method displays error 104
and i try
BrowserFieldRequest test = new BrowserFieldRequest("http://www.blackberry.com");
BrowserField myBrowserField = new BrowserField();
add(myBrowserField);
myBrowserField.requestContent(test);
the last 2 methods
it gives no error and display empty browser but after 120 seconds it gives connection timeout
Note: i try different url but it didn't solve the problem
any help,
Regarding the BrowserField,
If you are using a simulator, you should enable MDS-CS (Mobile Data System Connection Service) for the BrowserField to work properly (I don't know any other way). If MDS-CS is not enabled, follow this guide "Testing a BlackBerry device application with the BlackBerry Smartphone Simulator" on how to enable it.
If the MDS-CS is enabled, but you are using JRE 7.0.0 (9930 simulator), then the problem is that the MDS-CS version supplied with JRE 7.0.0 is incorrect (the symptom is that the MDS-CS window doesn't show up when you run the simulator). Check my answer for "Blackberry BrowserField error in Simulator" or "Blackberry webview can not connect to internet and/or display a web page" for more details and instructions.
Hope that one of the aforementioned will work for you.

Blackberry Browser isn't working on handhelds but it does in the simulator

I'm trying to launch the Blackberry browser from within my app and it works for the simulator, but it doesn't for the device.
This is the code:
public static void launchBrowser(String url) {
BrowserSession session = Browser.getDefaultSession();
session.displayPage(url);
}
It launched the browser, but it doesn't load the page. This is the error I get:
The protocol specified is not supported by the handheld.
Please try a different url.
Is there a way to do this? I'm pretty much desperate :-S
Also, as I'm launching the stand alone browser, it should work with BIS too, right?
Thanks in advance to everyone!
Problem fixed! Had forgotten to add the http:// before the url

Resources