Android JNI Programming (i)--jni concept and C language dev-c++ development environment building, writing HelloWorld

Source: Internet
Author: User

Copyright notice: This article from Administration Blog, reproduced please indicate the source: http://blog.csdn.net/a_zhon/.

Directory (?) [+]

One: What is JNI?

JNI:JNI is the abbreviation for Java Native Interface , which provides a number of APIs that enable the communication of Java and other languages (mainly c&c++), in simple terms Java tuning c,c java.

Second: start to build our development environment, is also very simple

dev-c++ tool download, install the default to finish on the OK.

工欲善其事, its prerequisite.
Adjust font Size: Under the menu bar tools–>editor options The font and color in this can change the fonts and colors.
Shortcut keys to view and modify: Under the menu bar Tools–>configure shortcuts ... You'll be able to see all the shortcut keys.
Modify Tool Language: Tools–>environment Options on the right, you can see a language.

Three: Now we can start writing my first C program.
//相当于java的import  stdio: standard input$output标准输入输出//.h头文件格式,包含一些函数#include<stdio.h>//导入标准的C语言函数库#include<stdlib.h>int main() { //输出函数 printf("Hello World! \n"); //使docs窗口停留 system("pause"); return 0;}//这里int 和return 0;可以省略不写
Four: The above code in the execution of a computer will play a docs window to you, you can see a HelloWorld.

Five: Since he opened the Docs command line, let's play a few fun
#include<stdio.h>#include<stdlib.h>main() {    //打开计算器,相当于在运行输入框输入calc    system("calc");    //使docs窗口停留 system("pause");}

As soon as the program runs, you'll find that it's amazing that he helped you open the calculator, and you can also open Notepad, artboards, and so on.

Here our HelloWorld program is done, and next we will continue to learn to hurt each other like friends.

Android JNI Programming (i)--jni concept and C language dev-c++ development environment building, writing HelloWorld

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.