Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7168135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:43:07+00:00 2026-05-28T14:43:07+00:00

I am currently designing a native android application. I am planning to use jQuery

  • 0

I am currently designing a native android application. I am planning to use jQuery Mobile web view as my interface and do all the calculations with java back-end. (still deciding using phonegap or not)

I have some difficulties implementing a page that allows a user to fill in a form and pass the variable to the android java part.

Researching all morning, I have learned how to interact between javascript/html and java with addJavascriptInterface(). But the only thing I can find that answer my question is with JSON. That seems a little complicated. Is there a way I can pass the variable as a parameter of a java function?

(I learned that if I do not use a web view, I can simply use getText() or getSelectedItem() with default UI to do what I want to)

I apologize there is no code avaliable, since this is still in designing stage, and I am a little new to android sdk.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:43:07+00:00Added an answer on May 28, 2026 at 2:43 pm

    OK, here’s an example of interacting with the javascript interface…

    Setting the javascript interface in your Activity…

    JavascriptInterface javasriptInterface = new JavascriptInterface(this);
    webview.addJavascriptInterface(javasriptInterface, "Android");
    

    The inner JavascriptInterface class in your Android Activity…

    public class JavascriptInterface {
        Context mContext;
    
        JavascriptInterface(Context c) {
            mContext = c;
        }
    
        public boolean doSomething(String name, String address) {
            ...
            return true;
        }
    }
    

    EDIT:
    Your form will have various input fields. Example…

    <form name="myForm" ...>
        <input type=text name=personName>
        <input type=text name=personAddress>
        <input type="button" value="Do it" onClick="callDoSomething()" />
    </form>
    
    <script type="text/javascript">
        function callDoSomething() {
            var theName = document.myForm.personName.value;
            var theAddress = document.myForm.personAddress.value;
            var result = Android.doSomething(theName, theAddress);
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently designing a web application which may be viewed by people in all
I am currently designing a web application where I will have customers signing up
I'm currently designing an architecture for a web-based application that should also provide some
I'm currently designing/reworking the databinding part of an application that makes heavy use of
I'm currently designing a Java application where a Rule engine could be useful. Where
I am currently designing a web application that will allow users to schedule tasks
I'm currently designing a windows mobile application using compact framework 3.5 and I need
I'm currently designing a simple forum application. It's mostly powered by jQuery/AJAX and loads
I'm currently designing a web application using DDD methodology. While distinguishing the Entities from
I am currently designing a class library that will provide data to a web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.