I am making a jQuery Mobile and PhoneGap app.
I am about to save some data to local storage. I am wondering if it is safe on mobile browsers (Android, iOS and windows). On PC I am able to check the values in FireBug. Is it possible somehow on mobile devices? Can I access in app A data specified by app B?
Thanks for help.
At least in iOS, if it's a phonegap app the localStorage is only accesible from the app.
To check values while you are developing, you can try debug phonegap.(only works on webkit browsers). If you put a name there, it creates a script tag to include in your index. If you include that script tag in your index and execute the app you can see a remote web inspector for your app.
Related
I'm attempting to create an audio router app in Electron. I used DetectRTC (https://github.com/muaz-khan/DetectRTC) to get the list of audio devices on the computer.
How would I go about changing the Windows default audio device via JavaScript, or is it even possible?
Forgot about this project but as far as I know it's impossible to control os level audio settings from the browser. I think a good option for this would be to use C# and Windows core libraries, as in this implementation. Then, the C# could be run within an electron app using electron-cgi.
I am building my Apps with JavaScript using Cordova and Electron for mobile and desktop apps. In my App, I have a offline feature, where you can download content which is saved using localforage. It works great to show my images, audios, videos and so on.
However, I also have files in the app for users to download (zip, pdf, ...), by using the window.open command, which works as long as I'm using the file's url from the server. But when I use the offline feature and use the blob-url from my localforage, the app doesn't react at all to my onClick event. It doesn't open and also showing no errors in the console.
In the browser though it works just fine, whether it's the blob-url or server-url.
I first used window.open(src, '_blank');, but also tried to remove the _blank attribute with no luck.
Any help would be very appreciated! Thanks!
I am currently making a web app and I have used a manifest file to get my web app to work offline. This works great and using Google Chrome, Opera etc I can view what is being cached by right clicking, inspecting the element and viewing the resources.
The problem I have is that I want to view what is stored in the cache in the app when it is being used on an i-pad. I have give this a Google but cant seem to find anything. Is there a way of displaying what is stored in the cache using some JavaScript or JQuery and then having this displayed on a web page within the app.
The app consists of a webview which is currently pulling in other html pages which are being stored in the cache using the manifest. I want to add a simple settings page where what is being stored in the cache can be viewed within the app. Hope that explains enough I would really appreciate any help with this matter.
I don't know of a way to get at this information with JavaScript either, but here are the alternatives I use.
In Mobile Safari, I connect the device to a Mac, open Safari on the Mac, open the site in Mobile Safari or open the native app going to the screen with the UIWebView, go back to the Mac and open the Develop menu. From there you can select the Storage option and view what's in the appcache.
In Chrome, you can view what's stored in the appcache using the URL chrome://appcache-internals/.
If the appcache was saved successfully, you could also simply go to the file itself in your browser.
Let me first start out by saying I know how to use the iOS SDK so please don't answer this with a "just use the SDK." I want to know WHY google analytics is not working.
Here's my setup. I have a web app that is also baked into an android app and ios app via webview. I'm using cordova. The android app works just fine with the GA JS code. The web works just fine. However no events or page views are showing up from iOS. I've heard that GA is tied to the domain so does an iOS Webview do something under the hood to the domain?
I was going to attach my code snippet but it's coffeescript in a few classes so I'll just paste the compiled js
Analytics.prototype.track = function(args) {
window._gaq.push(args);
};
Analytics.track(['_trackEvent', 'SubscriptionModal', "Closed", data]);
This works fine in web and android so it's not a JS. I'm setting the GA _setDomainName to 'focusatwill.com' and can see that both ios and web have a domain of 'www.focusatwill.com'
I've read online a few people talking about this issue and everyone says just use the SDK. I'm looking for the reason why it doesn't work. How do you fix it to use the JS?
edit
I should mention that the html and JS are not baked into the device, ie they don't have a local url but are served up from our webserver
Safari on iOS6+ blocks third party cookies by default, and I'm certain that webviews do too.
Check that you have something similar to the following in the init method of AppDelegate.m:
NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
That's from the standard boilerplate generated by Cordova 3.0.9, but might not be present if you're using a version that predates iOS6. It sets the app-specific cookie policy, which should override the system default.
I have written a phonegap application, and it performs a pretty simple task, it gets some JSON from a YQL link, and then displays it nicely to the user. This works excellently when I run it using Google Chrome on a Desktop, but, my client tells me that it does not work on his device which is Android 2.3. What can be going wrong? I'm using phonegap build to build to app, and they tell me that it is given internet permission, but, when my client puts the APK on the phone (its not on the market yet), does he need to do something special for it to access the internet?
Thanks a lot,
Dhaivat
in phonegap, allow external host : Open phonegap.plist -> external host and add your url or * to allow all
within the phonegap app the webapp runs under the file:// protocol - this might affect things.
you should test this at least on an emulator yourself - clients usually screw up anything some might screw up when testing ;) best would be to test on an actual device tho.
I'm not sure if this will help but I had a similar problem testing my app here:
https://stackoverflow.com/questions/17496104/json-wordpress-feed-not-appearing-in-android-studio-emulator-using-phonegap
I needed to change access origin to ="*"/ in my config.xml