Commit e1bd8880249320cb216969b1f4a3cf004ef8f93e
1 parent
bd32c5c6
Exists in
master
and in
5 other branches
Testando criação de módulo jni para android
Showing
5 changed files
with
149 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | +# | |
| 2 | +# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | +# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | +# aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 5 | +# | |
| 6 | +# Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | +# | |
| 8 | +# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | +# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | +# Free Software Foundation. | |
| 11 | +# | |
| 12 | +# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | +# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | +# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | +# obter mais detalhes. | |
| 16 | +# | |
| 17 | +# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | +# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
| 19 | +# Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | +# | |
| 21 | +# Contatos: | |
| 22 | +# | |
| 23 | +# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 24 | +# | |
| 25 | + | |
| 26 | +JAVAH=javah | |
| 27 | +NDKBUILD=/opt/android-ndk-r8/ndk-build | |
| 28 | +CLASSPATH=br/com/bb/pw3270 | |
| 29 | + | |
| 30 | +all: | |
| 31 | + @$(NDKBUILD) -C jni | |
| 32 | + | |
| 33 | +Debug: | |
| 34 | + @$(NDKBUILD) -C jni | |
| 35 | + | |
| 36 | +jni/lib3270jni.h: bin/classes/$(CLASSPATH)/lib3270.class | |
| 37 | + @$(JAVAH) -o $@ -classpath bin/classes $(subst /,.,$(CLASSPATH)).lib3270 | |
| 38 | + | ... | ... |
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | +# | |
| 2 | +# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | +# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | +# aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 5 | +# | |
| 6 | +# Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | +# | |
| 8 | +# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | +# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | +# Free Software Foundation. | |
| 11 | +# | |
| 12 | +# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | +# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | +# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | +# obter mais detalhes. | |
| 16 | +# | |
| 17 | +# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | +# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
| 19 | +# Place, Suite 330, Boston, MA, 02111-1307, USA | |
| 20 | +# | |
| 21 | +# Contatos: | |
| 22 | +# | |
| 23 | +# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 24 | +# | |
| 25 | + | |
| 26 | +LOCAL_PATH := $(call my-dir) | |
| 27 | + | |
| 28 | +include $(CLEAR_VARS) | |
| 29 | +include ../../lib3270/sources.mak | |
| 30 | + | |
| 31 | +LOCAL_CFLAGS=-I ../../include | |
| 32 | +LOCAL_MODULE := lib3270 | |
| 33 | +LOCAL_SRC_FILES := $(foreach SRC, $(SOURCES), ../../lib3270/$(SRC)) | |
| 34 | + | |
| 35 | +include $(BUILD_SHARED_LIBRARY) | |
| 36 | + | ... | ... |
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |
| 2 | +<CodeBlocks_project_file> | |
| 3 | + <FileVersion major="1" minor="6" /> | |
| 4 | + <Project> | |
| 5 | + <Option title="lib3270 android NDK" /> | |
| 6 | + <Option pch_mode="2" /> | |
| 7 | + <Option compiler="gcc" /> | |
| 8 | + <Build> | |
| 9 | + <Target title="Debug"> | |
| 10 | + <Option output=".bin/Debug/lib3270 android NDK" prefix_auto="1" extension_auto="1" /> | |
| 11 | + <Option object_output=".obj/Debug/" /> | |
| 12 | + <Option type="1" /> | |
| 13 | + <Option compiler="gcc" /> | |
| 14 | + <Compiler> | |
| 15 | + <Add option="-g" /> | |
| 16 | + </Compiler> | |
| 17 | + </Target> | |
| 18 | + <Target title="Release"> | |
| 19 | + <Option output=".bin/Release/lib3270 android NDK" prefix_auto="1" extension_auto="1" /> | |
| 20 | + <Option object_output=".obj/Release/" /> | |
| 21 | + <Option type="1" /> | |
| 22 | + <Option compiler="gcc" /> | |
| 23 | + <Compiler> | |
| 24 | + <Add option="-O2" /> | |
| 25 | + </Compiler> | |
| 26 | + <Linker> | |
| 27 | + <Add option="-s" /> | |
| 28 | + </Linker> | |
| 29 | + </Target> | |
| 30 | + </Build> | |
| 31 | + <Compiler> | |
| 32 | + <Add option="-Wall" /> | |
| 33 | + </Compiler> | |
| 34 | + <Unit filename="Makefile" /> | |
| 35 | + <Unit filename="jni/Android.mk" /> | |
| 36 | + <Extensions> | |
| 37 | + <code_completion /> | |
| 38 | + <debugger /> | |
| 39 | + </Extensions> | |
| 40 | + </Project> | |
| 41 | +</CodeBlocks_project_file> | ... | ... |
| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | +package br.com.bb.pw3270; | |
| 2 | + | |
| 3 | +import android.app.Activity; | |
| 4 | +import android.os.Bundle; | |
| 5 | + | |
| 6 | +public class PW3270Activity extends Activity { | |
| 7 | + /** Called when the activity is first created. */ | |
| 8 | + @Override | |
| 9 | + public void onCreate(Bundle savedInstanceState) { | |
| 10 | + super.onCreate(savedInstanceState); | |
| 11 | + setContentView(R.layout.main); | |
| 12 | + } | |
| 13 | +} | |
| 0 | 14 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +package br.com.bb.pw3270; | |
| 2 | + | |
| 3 | +public class lib3270 { | |
| 4 | + | |
| 5 | + static | |
| 6 | + { | |
| 7 | + System.loadLibrary("3270jni"); | |
| 8 | + } | |
| 9 | + | |
| 10 | + /** | |
| 11 | + * @param args | |
| 12 | + */ | |
| 13 | + public static void main(String[] args) | |
| 14 | + { | |
| 15 | + // TODO Auto-generated method stub | |
| 16 | + | |
| 17 | + } | |
| 18 | + | |
| 19 | + public native String getVersion(); | |
| 20 | + | |
| 21 | +} | ... | ... |