jni_utils.h revision 0c1d1cdabd0d3bb762788ac04f9d6784c0b3f848
1// Copyright (c) 2010 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include <string> 6 7#include "base/string16.h" 8#include "nativehelper/jni.h" 9 10namespace android { 11 12// Get the JNI environment for the current thread. 13JNIEnv* GetJNIEnv(); 14 15// Convert Java String to std::string. On null input, returns an empty string. 16std::string JstringToStdString(JNIEnv* env, jstring jstr); 17 18string16 JstringToString16(JNIEnv* env, jstring jstr); 19 20} // namespace android 21 22