Start an android Activity from PhoneGap javaScript - javascript

I am trying to start an android activity from my phonegap javascript file. I have seen a few post from years ago when DroidGap was still utilized. Does anyone know how to do this with the current updated version of phoneGap? Please do not point me to any posts that refer to the old version of PhoneGap.

What you probably want is a native plugin.
You can call your native code from within your JavaScript and then stat your activity as usual.
Documentation for plugins (for android) is located here.

Related

Android: Getting a String from an android app through a browser call

I am building a Hybrid application for android which has a String value stored in a variable.
I have the application installed in my mobile, and now I need to fetch the String value (from that hybrid app) through a JavaScript call from a browser (web page opened in the same mobile). How can I achieve this?
Forgive for the abstractness in the question, as I am a newbie to both Android and Web app development.
Answering my own question, hoping it might help anyone later.
After so much of online reading, I've found it is not possible to read values embedded within another app. (Except exposing the variable through an external API as Mr. Michal Hainc pointed out rightly in the comment)

How to create PhoneGap plugin out of an android application

I am basically using this https://github.com/googlesamples/android-vision with a few changes and it works perfectly on my android device.
Anyway, I would like to use it inside PhoneGap. The idea is to build the rest of the application in javascript/html/css and when pressed a specific button, start the android app.
Can this be done by someone who has never created a plugin before?
I would be grateful for any hint or tutorial on how to do it.
Of course it depends of your dev skills but I created myself my first plugin two months ago without being a Phonegap/Cordova expert, I'm a Java developer since 15 years but the most important thing is your motivation.
You first have to develop your basic Cordova app:
https://cordova.apache.org/docs/en/latest/guide/cli/index.html
Then your ressource to create a plugin will be here: https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html
You will have to create one or few Java files as an adapter between your web app and your Jar code.
I found that the documentation was not enough for my case but I googled and used some dev blog articles and found some StackOverflow questions to help me.
Good luck!

Execute JS file from Xcode without UIWebView

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

Sample WebView application source code Android

I'm working on an HTML5 based Android App, and I don't understand how to get WebView working. I was wondering if anyone could point me to a place where I can download the source code for an example application of this so I can modify it for my app, or at least reference it. It needs JavaScript support, and to open links in WebView, instead of in the Browser application, which I heard happens unless you change a setting. It will access local files only, not from the internet, but might later on interface with database systems, so it needs the Internet permission, but I think I understand how to add that. Thank you!
I will suggest you too have a look on Cordova.
You can find everything to start a hybrid android app.

PhoneGap application showing old iOS 6 keyboard and old picker

I have recently started using html, javascript and css to build an app with PhoneGap. The first time I uploaded and ran it on my iPhone (running iOS 7) it showed the regular iOS 7 keyboard and picker. I then made some changes to the app, uploaded it and ran it but the keyboard and picker had reverted back to iOS 6 and before keyboards. Now what?
I am not using any external javascript frameworks right now and not using an IDE, just a simple code editor for explicitly writing the code.
Picker refers to the UIPickerView that shows in iOS web views on combo boxes.
Had the same issue for a while. I figured it was the javascript framework's fault. The real issue was the launch image. If the launch image doesn't fit the exact specifications it will launch the app in compatibility mode.
You can find the necessary specifications here: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ExpectedAppBehaviors/ExpectedAppBehaviors.html#//apple_ref/doc/uid/TP40007072-CH3-SW3
As an aside, I used this app from the mac app store in order to get the launch images exactly right. Worked great for me. https://itunes.apple.com/gb/app/asset-catalog-creator-free/id866571115?mt=12

Categories

Resources