Click here to Skip to main content
11,924,573 members (57,560 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Linux
Hi all,
i am working in android ndk using java api.Please help me.
My code in
package com.marakana;
import android.R.bool;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
public class NativeLib {
static {
Context mContext;
 public NativeLib(NDKDemo ndkDemo) {
public  void Keyboard(Context mContext){
	       this.mContext = mContext;
 public  void  getSystemService(bool makevisible){
     if(makevisible != null){
	        InputMethodManager m = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
	        m.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    	 InputMethodManager m = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
	        m.toggleSoftInput(0, 0);
  public native void  openKeyBoard();


/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_marakana_NativeLib */
#ifndef _Included_com_marakana_NativeLib
#define _Included_com_marakana_NativeLib
#ifdef __cplusplus
extern "C" {
 * Class:     com_marakana_NativeLib
 * Method:    add
 * Signature: (II)I
JNIEXPORT jstring JNICALL Java_com_marakana_NativeLib_openKeyBoard
  (JNIEnv *, jobject);
#ifdef __cplusplus

1.How to impliment java function in c/c++ to call c++ function by java for display keyboard.

Please help me.

Thanks in advace.
Posted 17-Sep-12 19:53pm
Edited 17-Sep-12 21:18pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you need to learn how to use the JNI then see the developers guide[^].

I notice that this is the fourth time you have asked what is, essentially, the same question, so what have you actually tried up to now and what results have you obtained?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151125.3 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100