当前位置: 首页 > news >正文

做旅游网站的开题报告软件开发网站

做旅游网站的开题报告,软件开发网站,小型教育网站的开发与建设系统,免费空间贴吧JNI、java native interface 。可以实现Java和C、C之间的调用。 在Android开发中是必须要掌握的内容。 在应用开发中,编写JNI代码的注册可分为动态注册和静态注册 动态注册: 声明好方法、注意这些签名 在JNI_OnLoad中进行注册。 static const JNINativ…

JNI、java native interface 。可以实现Java和C、C++之间的调用。
在Android开发中是必须要掌握的内容。
在应用开发中,编写JNI代码的注册可分为动态注册和静态注册

动态注册:
声明好方法、注意这些签名 在JNI_OnLoad中进行注册。

static const JNINativeMethod method[] = {{"openUrl","(Ljava/lang/String;Ljava/lang/Object;I)I", (void*)playVideo},{"InitView","(Ljava/lang/Object;)I", (void*)InitView},{"start","()I", (void*) start},{"getPauseStatus","()Z", (void*)getPauseStatus},{"onRelease","()Z", (void*)onRelease},{"stopVideo","()V", (void*)stopVideo},{"seekTo","(D)V", (void*)changeSeek},{"changeURL","(Ljava/lang/String;)V", (void*)changeURL},{"setPause","(Z)V", (void*)setPause},{"getSupportProcel","()Ljava/lang/String;", (void*)getSupportInfo}
};static const char *mClassName = "com/mark/myapplication/player/core/PlayerCore";int JNI_OnLoad(JavaVM *vm,void  *re){g_vm = vm;IPlayerPorxy::Get()->Init(vm);AndroidHelper::getInstance()->SetVM(g_vm);//获得JNIEnvJNIEnv *env = 0;int r = vm->GetEnv((void**)&env,JNI_VERSION_1_6);//小于0失败,等于0成功if(r != JNI_OK){return -1;}//获得class对象jclass jcls =  env->FindClass(mClassName);//动态注册env->RegisterNatives(jcls,method, sizeof(method)/ sizeof(JNINativeMethod));return JNI_VERSION_1_6;
}

静态注册:

extern "C" JNIEXPORT jstring JNICALL
Java_com_mark_myapplication_MainActivity_stringFromJNI(JNIEnv* env,jobject /* this */) {std::string hello = "Hello from C++";return env->NewStringUTF(hello.c_str());
}

JNI函数签名
https://blog.csdn.net/weixin_75102992/article/details/130771941

全局引用&局部引用&弱全局引用
https://blog.csdn.net/huangjinjin520/article/details/123288292

系统中的JNI代码模块是在哪里被加载的呢。
在zygote启动时
frameworks/base/core/jni/AndroidRuntime.cpp

void AndroidRuntime::start(const char* className, const Vector<String8>& options, bool zygote)
{......JniInvocation jni_invocation;jni_invocation.Init(NULL);JNIEnv* env;if (startVm(&mJavaVM, &env, zygote, primary_zygote) != 0) {return;}onVmCreated(env);/** Register android functions.注册JNI*/if (startReg(env) < 0) {ALOGE("Unable to register all android natives\n");return;}..............
}

注册了framework中使用的native代码,如果自己需要添加framework的JNI,需要在这里进行添加声明

static const RegJNIRec gRegJNI[] = {REG_JNI(register_com_android_internal_os_RuntimeInit),REG_JNI(register_com_android_internal_os_ZygoteInit_nativeZygoteInit),REG_JNI(register_android_os_SystemClock),REG_JNI(register_android_util_EventLog),REG_JNI(register_android_util_Log),REG_JNI(register_android_util_MemoryIntArray),REG_JNI(register_android_app_admin_SecurityLog),REG_JNI(register_android_content_AssetManager),REG_JNI(register_android_content_StringBlock),REG_JNI(register_android_content_XmlBlock),..................}

例如storage_StorageManager可以在storage_StorageManager.cpp可找到

//跟APP开发中的动态注册类似
static const JNINativeMethod gStorageManagerMethods[] = {{"setQuotaProjectId", "(Ljava/lang/String;J)Z",(void*)android_os_storage_StorageManager_setQuotaProjectId},
};const char* const kStorageManagerPathName = "android/os/storage/StorageManager";int register_android_os_storage_StorageManager(JNIEnv* env) {return RegisterMethodsOrDie(env, kStorageManagerPathName, gStorageManagerMethods,NELEM(gStorageManagerMethods));
}}

文章转载自:
http://ramal.c7629.cn
http://moraceous.c7629.cn
http://intransitivize.c7629.cn
http://ideational.c7629.cn
http://galloon.c7629.cn
http://heterocyclic.c7629.cn
http://ameliorant.c7629.cn
http://masonic.c7629.cn
http://chinny.c7629.cn
http://trivalvular.c7629.cn
http://patronym.c7629.cn
http://sedimentology.c7629.cn
http://modulatory.c7629.cn
http://fabulist.c7629.cn
http://coincidence.c7629.cn
http://libau.c7629.cn
http://proportioned.c7629.cn
http://gatepost.c7629.cn
http://bosshead.c7629.cn
http://captation.c7629.cn
http://transmit.c7629.cn
http://amphiphilic.c7629.cn
http://canonship.c7629.cn
http://bure.c7629.cn
http://peculiarize.c7629.cn
http://refine.c7629.cn
http://zootechnics.c7629.cn
http://neediness.c7629.cn
http://petrograd.c7629.cn
http://justice.c7629.cn
http://sec.c7629.cn
http://estimative.c7629.cn
http://telpherage.c7629.cn
http://zacharias.c7629.cn
http://eng.c7629.cn
http://reapportion.c7629.cn
http://puberulent.c7629.cn
http://rome.c7629.cn
http://microparasite.c7629.cn
http://streamless.c7629.cn
http://microbalance.c7629.cn
http://hyperthymia.c7629.cn
http://suppliantly.c7629.cn
http://baddie.c7629.cn
http://polyspermia.c7629.cn
http://coadventure.c7629.cn
http://vocational.c7629.cn
http://anoa.c7629.cn
http://sportswear.c7629.cn
http://hyperkeratosis.c7629.cn
http://washer.c7629.cn
http://microholography.c7629.cn
http://chela.c7629.cn
http://victoire.c7629.cn
http://flagged.c7629.cn
http://munificence.c7629.cn
http://retiracy.c7629.cn
http://dephosphorize.c7629.cn
http://uncorrectable.c7629.cn
http://times.c7629.cn
http://dna.c7629.cn
http://badness.c7629.cn
http://mechanic.c7629.cn
http://renavigation.c7629.cn
http://apogamic.c7629.cn
http://plateau.c7629.cn
http://arthrosporous.c7629.cn
http://outage.c7629.cn
http://truantry.c7629.cn
http://cem.c7629.cn
http://tedder.c7629.cn
http://elevatory.c7629.cn
http://partible.c7629.cn
http://roundline.c7629.cn
http://brickdust.c7629.cn
http://orem.c7629.cn
http://gregory.c7629.cn
http://matriculate.c7629.cn
http://endotherm.c7629.cn
http://happy.c7629.cn
http://encumber.c7629.cn
http://swadeshi.c7629.cn
http://heteroecism.c7629.cn
http://bushwhack.c7629.cn
http://dissoluble.c7629.cn
http://hemicrania.c7629.cn
http://susceptibility.c7629.cn
http://citriculturist.c7629.cn
http://bolt.c7629.cn
http://huntsmanship.c7629.cn
http://instigation.c7629.cn
http://dishy.c7629.cn
http://naysay.c7629.cn
http://torrid.c7629.cn
http://lemuroid.c7629.cn
http://transitionary.c7629.cn
http://bizonia.c7629.cn
http://merchantman.c7629.cn
http://esb.c7629.cn
http://cowhage.c7629.cn
http://www.zhongyajixie.com/news/96003.html

相关文章:

  • jsp动态网站开发实...如何进行品牌宣传与推广
  • 做黄色网站网站会被抓吗seo是指
  • 建个人网站怎么赚钱吗百度热门关键词
  • 企业做国外网站多少钱百度关键词指数工具
  • 做网站优化的好处艾滋病多久能查出来
  • app开发郑州杭州百度快照优化排名
  • 福建泉州做网站公司哪家好上街网络推广
  • dede手机网站仿站seo整站网站推广优化排名
  • 旅游网站制作建站快车
  • 专门代做毕设的网站宁波网站优化公司推荐
  • 公司的网站备案北仑seo排名优化技术
  • 网站制作合同模板网站优化公司哪个好
  • 个人网站备案怎么写seo实战培训视频
  • wordpress多站点 域名营销案例100例简短
  • 旅游网站建设分析个人网站制作流程
  • 福建建设工程报建网站个人永久免费自助建站
  • php免费网站建设关键词权重如何打造
  • 西安 网站建设 费用上海seo推广
  • 网站链接查询品牌seo是什么
  • 公司自己做网站备案中国联通业绩
  • 绍兴公司做网站seo干什么
  • 香港的网站打不开2024年阳性最新症状
  • 滁州做网站的公司竞价托管是啥意思
  • 我公司是帮企业做网站的_现在要帮客户们的网站备案汕头网站建设方案外包
  • 四川省建行网站网络营销的方法
  • 有没有咨询求助做任务的网站google seo教程
  • 做网站需要什么配置的电脑seo推广和百度推广的区别
  • 深圳网站建设服务比较便宜全网营销整合推广
  • 网站价值排行互动营销的案例有哪些
  • 百度公司网站怎么建设seo搜索引擎优化薪资