Calling native function on android using Phonegap HTML5 [duplicate] - android

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Communication between Android Java and Phonegap Javascript?
I am just starting to develop using Phonegap and Android..
I would like to know,
if I have a button on the HTML page, would that button be able to call a native function?
For instance lets say i want the button to open up the calendar and pass variables from the html form
I am total newbie when it comes to Android native and HTML5
Please help

You basically need to call a javascript code on button click and write your own phonegap plugin to call native functionality.
Phonegap Android plugin development

yes it is possible you can call java codes from java script in phonegap.see here

Related

using loadUrl()

It's been a few years since I've tried to create an Android application and since everything has moved away from Eclipse and now onto AS my old templates no longer work. I'm looking for tutorials that allow me to use my own custom html, css and Jquery, seeing as stuff like super.loadUrl("file:///android_asset/www/index.html"); don't seem to work anymore.
Are there any links or anything anyone can provide to get me started on creating non java dependant application?
If you want to make an app without using java you can start learning ionic framework https://ionicframework.com/
You can also go through Apache Cordova. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development and you can also go with Xamarin that uses C# for cross-platform development.
You can also go through this tutorial for better understanding and for start learning from fresh :
Ionic tutorial https://www.youtube.com/watch?v=0jamhGf-8ww&list=PLYxzS__5yYQljbuGjaeugpqs9U07gS5P5
Cordova Tutorial https://www.youtube.com/watch?v=kqWZuEpHoSw&list=PLReL099Y5nRd9BNsMZwXvTDeqnfRMiGJy
Hope this will be helpful!!

How to show git-describe in React Native app?

I generally like to automatically bake-in the results of a git describe --always --dirty in any website, app, etc I am developing so that I can easily trace behaviors. Right now, I can't figure out a way to get this in a React Native app.
I am using Android, but am certainly looking for a solution to both Android and iOS.
I found a way using a mix of other existing answers:
Call git-describe during the build to access from gradle
Call PackageManager to access the gradle config from Java
Then use a React NativeModule in Java to access from JS
Update (3 years later): Here's a minimal diff that shows how to implement in Android.

Calling an activity from jquery in cordova

I am new to cordova so wanted to know if it is possible or not.
I have a functionality to implement, which I think I will be more comfortable in android native activity.
So can I call the native android from an html page or through jquery and the vice versa.
You need binding JavaScript code to Android code (bridge)
See official documentation
here is a good tutorial
http://itsmycodeshare.blogspot.in/2016/01/create-custom-cordova-plugins-using.html
and this is basic plugin example which interacts with js from Android java
https://github.com/don/cordova-plugin-hello
add your further activity and other code in <plugin_name>.java in src folder.

j2me to android [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
moving to android from j2me
shall we reuse the j2me source code for android application.i have the j2me source code.is this easy to convert the j2me code to android code
Hi You can fed your J2ME code and get android apk
Refer this url
http://www.netmite.com/android/srv/2.0/getapk.php
See this for an answer: Android and J2ME
There also exists automatic conversion service - http://upontek.com/J2MEtoAndroidServices.php you may want to try

Running JavaScript methods from Java in Android

I am writing application using PhoneGap on Android. I need to call some PhoneGap methods from native Java code. Anyone knows how to do that??
If you write your native code as an Android plugin (see an example here: https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner) then you have access to all of the PhoneGap Java classes and can call them as you like.

Categories

Resources