Execute JS file from Xcode without UIWebView - javascript

I have a JS file that makes a OData call, is possible run this file from xcode without a weview? Thanks

In iOS9 Apple introduced the SafariViewController that allows you to interface with web stuff in your app.
Here's a link to apples site and the wwdc video on it
I haven't used it but have been told that there isn't a lot of room for customization so that might not help you. However, there is also WKWebView and the WKWebKit framework that was introduced in iOS 8. This is very similar to UIWebview but has more functionality and utilizes WebKit API
Here's a link to apple's docs page about it and an in depth look at it from NSHipster

Related

What features are available in a cordova web view?

What features (HTML, JS, CSS, Web APIs), outside of plugins, are available in a cordova web view ? I am making a web app, and then I use cordova to create an apk file. The web app works fine with chrome and firefox for android. But when I try the generated apk on the same android device and the emulator the JavaScript is obviously not executed because buttons have no effect.
The initial HTML and CSS display fine, and I think I use some JavaScript or HTML5 features that are not available yet on cordova web view, but I don't know what I can use and what I cannot. I had a look at the emulator's error log but I get nothing meaning-full.
For example is it possible to use es2015 without transpiling, esModules etc, but I don't know where to look it up. What is the difference between a webview browser and chrome/firefox for android.
Targeting Android 4 and later.
https://cordova.apache.org/
It's probably easiest to look at the architecture diagram: https://cordova.apache.org/docs/en/latest/guide/overview/index.html.
Cordova apps consist of a small wrapper around a WebView (this is a "window" of the default browser installed by your mobile OS, although you can swap it out for another: https://cordova.apache.org/docs/en/latest/guide/hybrid/webviews/), with access to the mobile device's features via plugins. So... to answer your questions:
You can use any technology that's supported by the mobile browser you're working in. https://caniuse.com is super helpful in this regard.
You will also find that Android 4.x's stock web browser is not that great -- some of the shiny new popover UI stuff (walkthrough help and light boxes) will render, but the z-order is all messed up when you try to click to the next item. I've run into other issues as well, but I can't remember them off the top of my head.
The Crosswalk project allows you to embed a Chrome browser web view in older Android versions (back to 4.x I think). Support for this project has been discontinued in the latest Cordova releases, as it's no longer necessary.

Can Titanium code runs in browsers?

I understand that not all the code and functionality are available. However, I am currently in the planing of a new project and there are no document to be found on this aspect.
I want to know once I code in Titanium, is it possible to make a web version for mobile without the application with limited feature and the same code base? (something like touch.facebook.com vs Facebook app)
Thank you very much
Of course, Titanium could do that since it also supports MobileWeb. Titanium features:
Develop native applications for iOS, Android, BlackBerry, Windows, and
mobile web through a single code base.
With their Titanium Studio, you can easily build and package your app for MobileWeb.
But there are a lot of things to consider on developing titanium apps. Here are the few things I've learned along the way:
Don't use ImageView. Use View with backgroundImage. If it's an icon, you can make a font for your app. See how to create an icon font using IcoMoon.
Memory management
Never use borderRadius, borderWidth, borderColor in components within components, as for example a ScrollableView.
Minimize calling Ti.Platform.[property_name]. Example: instead of always calling Ti.Platform.osname to your controllers, you could have put it on you commonjs var osname = Ti.Platform.osname, then exports.getPlatformName = function() { return osname; };
Here are some few references:
http://developer.appcelerator.com/question/152656/tips-and-tricks-for-memory-management
http://developer.appcelerator.com/question/116867/this-is-a-solution-to-your-memory-woes#answer-203729
http://www.tidev.io/category/howtos/
Titanium SDK supports iOS, Android, BlackBerry, Tizen and HTML5 platforms. You can read more about that in their documentation. You can limit features in HTML5 app in a code with simple if() and reuse most of your codebase.
You can create a web version of the application if you include Mobile Web in the target platforms, when you create the project.
To deploy it on the browser, run the application as Mobile Web.
You may refer the following links for more details.
Getting Started with Mobile Web
Mobile Web Platform Overview
Mobile Web Limitations

A Productive Javascript/Phonegap Development Environment

I've been building Android apps for a few years now, and I've arrived to this working setup:
Intellij Idea IDE write/debug
Genymotion "Emulator"
Physical Device (only when needed)
Git
Ant (probably should move to Gradle) Release/Debug builds
And now I'm looking to form an equally productive environment for Javascript (Phonegap, etc), for Android/iOS/Win8Phone.
I want to avoid the "nice-text-editor-only" solution (I believe a full IDE is superior in productivity terms).
Any suggestions?
Try Brackets editor http://brackets.io/. It's a nice editor to code the web. Phonegap plugins also available for this editor. Just take a look at this editor. Make sure to download the version of Brackets with Phonegap Plugin compatibility.
For the Cordova/Phonegap app I developed, I used cloud9. In my workflow, I would first get things working in my browser, then occasionally do builds with Adobe's Phonegap Build service to work out the kinks on my mobile devices.
The nice thing about c9 is you'll have a public URL for the website you're developing so you can preview it in your device's browser, which is typically closer to the environment you'll get with Phonegap.
The weinre debugging tool, although slow if you're running it through http://debug.phonegap.com/, can really help track down problems when debugging on mobile devices.

Windows 8 Metro and Google Analytics

Will it be possible to use the Google Analytics JavaScript library (https://developers.google.com/analytics/devguides/collection/gajs/) for the Windows Metro JavaScript based application to trace views accessed by user?
In general, if a JavaScript library you want to use is on a CDN or a server external to your app, the answer is no, as Windows apps written with HTML/JavaScript cannot load external JavaScript libraries...if you try, a security exception will occur.
Many libraries will work fine if you copy the JS file into your project and run it locally. For example, jQuery works just fine this way. I have not tried the Google Analytics library, so you might just want to test it out and see if it will work with a local copy.
Something else to consider, however, is that unlike a web site, a Windows app written in HTML/JavaScript may occasionally be offline, in which case, a library written with the assumption of network connectivity would likely not work. So in this particular case, you might not get the data that you're hoping for.
Hope that helps.
we tried http://w8ga.codeplex.com/ (w8ga) to work with GA in our win8 js app.
Currently W8GA seems doesn't support html/js. Also I have no idea why developer didn't mension it( it's supports only c#/xaml metro app )
So, we found another way to do it; Look for cobra Tab 's answer at the bottom of this page: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/f81ebbb9-d711-40f1-8a82-9aed44e2d8fe/
And finally, we are waiting Adobe's Omniture sdk:
http://microsite.omniture.com/t2/help/en_US/sc/appmeasurement/winrt/index.html#Developer_Quick_Start
Hope these answers helps...
We're using the free version of markedup in our applications with great success. In addition to simple page views it shows you some app specific numbers like number of installs, exception details, etc.
I'd recommend using the Google Analytics SDK for Windows 8 and Windows Phone. It is built as a WinRT component and therefore supports both JS & Xaml Win8 apps.
Full disclosure: I am the author of this SDK; I built it for my own app and decided to open source it. There are other frameworks out there but AFAIK, none of them support the new GA universal analytics protocol so they only work with older GA properties and don't support all the cool new features GA recently added just for apps.

Desktop application development with Javascript and HTML

I am looking for Titanium Appcelerator alternatives for Desktop application development with HTML and JavaScript. I want to convert a web app to a desktop application. Hence, there will be a lot of server interaction. Appcelerator was a good choice, but it looks like the company is no longer interested in the Desktop SDK. Also, ajax request from Appcelerator does not retain cookies.
I read that Adobe Air can be used for desktop app development, but I don't want to use flash.
How good is XULRunner? Will it allow features like Growl notificaiton and creating tray icons?
Will I be able to develop applications using mostly Javascript and HTML in Qt?
I started looking into Titanium for desktop dev. I liked the concept but not the implementation. I then stumbled upon chromiumembedded and have been mostly very happy with it. It's basically a web browser control based on chromium.
http://code.google.com/p/chromiumembedded/
It's written in C++ so you can do all the low level OS stuff you want(Growl, tray icons, local file access, com ports, etc) in your container app, and then all the application logic and gui in html/javascript. It allows you to intercept any http request to either serve local resources or perform some custom action. For example, a request to http://localapp.com/SetTrayIconState?state=active could be intercepted by the container and then call the C++ function to update the tray icon.
It also allows you to create functions that can be called directly from javascript.
My biggest challenge has been debuging. It's very difficult to debug javascript directly in CEF. There's no support for anything like Firebug that I am aware of.
Appjs (appjs.org) looks very promising.
You could also check Bowline which is another alternative: http://bowlineapp.com/.
Although it's not officially intended for general-purpose use, a number of people have had success using brackets-shell for HTML/JS desktop apps. It embeds Chromium (CEF) and adds APIs for menu bar management and file IO. It also embeds an instance of Node.js so you get access to all its APIs for launching processes, etc. It's MIT-licensed and available for Mac & Win, with a Linux version currently making rapid progress.
As I mentioned, it's not officially a general-purpose app shell, but someone wrote a detailed blog post about how to customize brackets-shell for your own uses.
I notice that the other answer about Titanum says CEF is hard to debug. I'm not sure if that's true in Titanium, but in brackets-shell it's easy to debug JS – you just open http://localhost:9234/ to load a full instance of the Chrome Developer Tools (including breakpoints, profiling, etc.).
TideSDK is a continuation of the old Titanium desktop http://www.tidesdk.org/

Categories

Resources