4S Device Communication Module Collection  Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
android.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2015 The 4S Foundation (www.4s-online.dk)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
34 #ifndef ANDROID_H
35 #define ANDROID_H
36 
37 #include <jni.h>
38 
42 #define JNIVER JNI_VERSION_1_6
43 
44 
45 namespace PAL {
46 
54 class Android {
55 public:
64  static JavaVM *getJavaVM();
65 
66 
76  static jobject getClassLoader();
77 
78 
88  static jobject getContext();
89 
90 
109  static void setContext(jobject contextRef);
110 };
111 
112 } // namespace PAL
113 
114 #endif // ANDROID_H
static void setContext(jobject contextRef)
Provide a reference to the Android Context.
Definition: android.cpp:169
static jobject getContext()
Get a global reference to the Android Context.
Definition: android.cpp:208
Definition: android.h:45
Handles to the Java VM running our Android service.
Definition: android.h:54
static jobject getClassLoader()
Get a global reference to the Java ClassLoader.
Definition: android.cpp:164
static JavaVM * getJavaVM()
Get a pointer to the Java VM instance used to connect to Android.
Definition: android.cpp:159