2008年11月13日

NyARToolkit for Android & G1

I implemented NyARToolkit for Android to G1.

*Usage
1, Please install NyARToolkit for Android & G1 from Android Market(Applications: Software libraries) or ADB install NyARToolkitAndroid.apk.
2, Please print marker.jpg file.
3, Please start NyARToolkit for Android & G1.
4, Please preview marker.jpg with a camera.
5, A Cube object appears on marker.jpg.

*Source Download
- Eclipse Project with Source Code
- Apk package
- marker.jpg
- Socket Version
--It is not a Camera device but a version which acquires a picture by Socket as before.


*Thnaks
- NyARToolkit Project
- CAVE CO., LTD.
- Japan Android Group

comments

実機にインストールしましたが、
マーカーをうまく認識してくれません。
何か方法がありますか?

  • moge
  • 2009年06月23日 17:19

mogeさん

注意点は、2点あります。

1,マーカーがよく使われる「Hiro」でありません。
日本Androidの会っぽく「JAG」としてあります。

2,G2(HT-03AやGDDフォン)では、未テストです。すみません。
余裕が出来たときに見てみますが、確か動いていた気がします・・・

  • noritsuna
  • 2009年06月23日 20:30

うまく動きました。
向きがあるんですね。
印刷したマーカーだとうまくいかず、
ディスプレイのマーカーだとうまくいきました。

  • moge
  • 2009年07月01日 21:09

コメントを入力してください
I am the new in endroid, i am graduate student , i want to make a final project using this technology.

Could you prodes the steps , how to install this toolkit using Ecllipse plugin with google Android (ADT) plug in.

It helps me a lot.

  • Purvik
  • 2009年11月08日 16:24

Hi, Purvik.

I made SDKr3 version newly. Please use this.

1, Please install ADT with SDK Platform Android 1.1, API2, revision 1.

2, Please download new version sorce code.
http://www.noritsuna.jp/download/NyARToolkitAndroid-1.0.1-forSDKr3.zip

3, Import NyARToolkitAndroid project into Eclipse workspace.

3,1, Selcet [File] - [Import]
3,2, Choice [General] - [Existing Projects into Workspace]
3,3, Imput [Select root directory] into NyARToolkitAndroid project directory.
3,4, Click Finish.

  • noritsuna
  • 2009年11月08日 18:10

Hi noritsuna

I've done everything following you but I've got errors in NyARToolkitAndroidActivity.java about onclick,surfacecreated,surfacechanged,surfacedestroyed method
And the console displays

[2009-11-28 19:35:47 - NyARToolkitAndroidActivity]R.java was modified manually! Reverting to generated version!
[2009-11-28 19:44:39 - NyARToolkitAndroid]R.java was modified manually! Reverting to generated version!

What should I do next.

Thank you very much

  • bluz
  • 2009年11月28日 21:52

Hi, bluz

Are you using SDKr3 version NyARToolkitAndroid?

Download
http://www.noritsuna.jp/download/NyARToolkitAndroid-1.0.1-forSDKr3.zip

  • noritsuna
  • 2009年11月29日 18:08

Hi, All

Sorry!!!

NyARToolkitAndroid-1.0.1-forSDKr3.zip is old version workspace.

I create newer version workspace.
Please download.
http://www.noritsuna.jp/download/NyARToolkitAndroid-2.0.0-forSDKr3.zip

  • noritsuna
  • 2009年12月08日 21:29

Sorry, This server clashed & lose comment data.
I repair by my mail.


Name: dan
Date: 1/7/2010 18:28
Comments:
Hi ,

Could you please tell me if I can use the code on Android SDK version 1.
5 or on SDK version 2.0.

When i tried running the code you have shared on SDk version 1.5 the cod
e crashed on the first call to the core ART at arToolkit = new ARToolkitD
rawer(camePara, patt, mRenderer);

I have imported both the projects that you have shared and ran it on G1
phone.

Thanks for the help.

Name: kiki
Date: 1/8/2010 4:21
Comments:

I try to run the last version. Why it is just a black screen when I run
the program on G1 or emulator successfully? Is the program for using the
camera in G1 or just for using a web camera? Looking forward to your repl
y! Thank you.

Name: noritsuna
Data: 1/10/2010 0:00
[This comment is lost]

New version release.
http://www.noritsuna.jp/download/NyARToolkitAndroid-2.0.1-forSDKr3.zip


Name: kiki
Data: 1/12/2010 7:27
Comments:

Thanks noritsuna! I have run it successfully! However, the speed is stil
l slow. Have you consider to improve the speed? How about using video cap
ture instead of snapshot? How do you think? I really appreciate for your
help! Looking forward to your reply! Thanks.

  • noritsuna
  • 2010年01月13日 18:12

Hi, noritsuna!
I am trying to get NyArtoolkitAndroid running on 64-bit Win7 in Eclipse 3.51. I downloaded ...-2.0.1-forSDKr3.zip, imported the 2 projects to Eclipse, but when building I get this: [2010-01-14 19:34:46 - NyARToolkitAndroid]warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
[2010-01-14 19:35:12 - Dex Loader]Unable to execute dex: null
[2010-01-14 19:35:12 - NyARToolkitAndroid]Conversion to Dalvik format failed: Unable to execute dex: null

I want to know which operating system and Eclipse version You use?

  • Henri
  • 2010年01月15日 03:01

Alright I made new workspace and imported the projects and NyARToolKitAndroidActivity started :), but how can I can only use my webcam. How can I send video to a socket. I have a http serving webcam and I got Tom Gibara's HttpCamera working couple of days ago with webcam7 httpcamera.

  • Henri
  • 2010年01月15日 04:19

Hi

looking forward to get this running. When I'm running from eclipse, it depends on the core-files. I can only run the core-setup = black screen...

  • Jesper Johansen
  • 2010年01月17日 06:05

I have downloaded NyARToolkitAndroid-2.0.1-forSDKr3.zip and trying to make it work with Google API (platform 2.1, API level 7, SDK version 4).

I made a new project fro the WebcamBroadcaster and changed the strings.xml to use the SocketCamera. I verified that the connection to the broadcast is made when running in the emulator, but I don't get the picture (only shows the Loading picture on emulator screen).

Is there anything I can do to make it work or I have to use Android SDK 3 and SDK platform 1.5?

Thank you, noritsuna for all your work.

  • Harrys
  • 2010年01月20日 10:31

Update: I have now been able to get the example running by converting the socket camera to http camera, so currently I download a 320x240 jpg with http that has a marker drawn on it and the code finds the marker and draws that blue 3d model on it :). I tried it with 640x320 sized image, but somewhy there is a very big allocation made and something crashes: 01-20 15:09:29.003: ERROR/AndroidRuntime(214): Uncaught handler: thread Thread-9 exiting due to uncaught exception
01-20 15:09:29.011: ERROR/AndroidRuntime(214): java.lang.OutOfMemoryError
01-20 15:09:29.011: ERROR/AndroidRuntime(214): at jp.nyatla.nyartoolkit.core.param.NyARObserv2IdealMap.(NyARObserv2IdealMap.java:48)

Jesper I reccommend you to look at LogCat and see maybe u get some exception also.

  • Henri
  • 2010年01月20日 23:47

Hi, Henri & Harrys

Sorry, The reply became slow.

WebCamera program is WebcamBroadcaster/WebcamBroadcaster.class .

Please run WebcamBroadcaster/WebcamBroadcaster.class and write your PC's IP address in values/strings.xml server_addr.
(with Java Media Framework.)

The parameter which adjusts the size of a Bitmap is

jp.android_group.artoolkit.ARToolkitDrawer
Line 72 :
options.inSampleSize = 4;

Bitmap is to 1/4.
Please adjusts this parameter or

jp.android_group.artoolkit.ARToolkitDrawer
Line 78 :
if(bitmap.getHeight() < 240) {

  • noritsuna
  • 2010年01月21日 10:06

Hi, kiki

> However, the speed is stil
> l slow. Have you consider to improve the speed?

Yes, This program is very slowly.
I think to make NDK version.

  • noritsuna
  • 2010年01月21日 11:34

hi

i have a htc hero how i can get ur program to work on my phone

  • robert
  • 2010年01月21日 23:24

I thank you for the answers! But i still can't use WebCamBroadcaster. I think it's because I have windows 7 and JMF won't work on it. My capture device dont have RGBFormat, so I changed it to YUVFormat in WebcamBroadcaster, but then got another error: that said something like ".... jmvfw not in the library.path". I tried reinstalling JMF, but now it wont eaven detect my usb webcam. Im gonna try it on winXP virtual machine. Actually what I need is just drawing the 3D graphics on the video, I do not need marker detection. Do you know what would be the most simple way to do it?

  • Henri
  • 2010年01月22日 21:23

Hi, robert

Please try this APK.

http://www.noritsuna.jp/download/NyARToolkitAndroid.apk

  • noritsuna
  • 2010年01月22日 21:27

Hi, Henri

> Actually what I need is just drawing the 3D graphics on the video, I do not need marker detection.

Sorry, I don't know.

  • noritsuna
  • 2010年01月22日 22:15

Well, it was a bit foolish of me to ask it that way :). I'll try to be more precise: I just want to draw a cube with OpenGL so that on the background there is the video from the camera. Like with marker detection, the cube is drawn on the video. I don't want to know the simplest way to do it. I want to know which class in NyARToolkitAndroid draws the OpenGL geometry on the bitmapped image?

  • Henri
  • 2010年01月22日 23:15

Hi, Henri

3D renderer is

jp.android_group.artoolkit.ARToolkitDrawer
&
jp.android_group.artoolkit.ModelRenderer

source files.

But this how to do is old version.
I am developing new version.(Android 2.x native version)

If you want it soon, please you google it.

  • noritsuna
  • 2010年01月23日 17:14

hi

thanks for the APK it worked, can u tell me what u changed + can i get the code

do you know if there is any documentation in english?

  • Robert
  • 2010年01月29日 20:44

Hi Robert,

source code:
http://www.noritsuna.jp/download/NyARToolkitAndroid-2.0.1-forSDKr3.zip


I don't have & know doc in english, sorry.

  • noritsuna
  • 2010年01月30日 03:25

hi noritsuna..
i've download the source code and it appear some error, it said

The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files Dev1Camera.java

how to fix this?

  • 2010年02月09日 13:57

i've import the two projects but it appear some error..

Unhandled exception type IOException AttachedCamera.java NyARToolkitAndroid/src/jp/android_group/artoolkit/hardware line 218 Java Problem

how to fix this?

  • rassel
  • 2010年02月09日 15:00

Hi rassel,

Do you use on Android-2.x?

This app don't run on Android-2.x.
I will create new version.
Please wait a minutes.

  • noritsuna
  • 2010年02月09日 20:25

no, i'm not using android-2.x
i'm using android 1.6 but it appear some error on the attachedCamera.java and Dev1Camera.java (Unhandled exception type IOException) i've tried to put some try-catch or throw IOexception but not solve the problem..

can you help me?
Thanks noritsuna.

  • rassel
  • 2010年02月10日 16:06

I am having some difficulty understanding the code I was wondering if anyone could help me, I would like to modify the existing code to add buttons to the bottom of the display, that will launch new activities. I am just learning the android sdk and I have managed to create buttons that can launch new activities but i am having difficulty integrating it with the current code

  • Robert
  • 2010年02月11日 02:53

hi robert.
im having some error on building the nyartoolkit on eclipse using android 1.6..
can you run the nyartoolkit on yours?
what ide or version of android do you use?

  • rassel
  • 2010年02月11日 18:20

eclipse 3.5
android 1.5
i can run a verson of nyartoolkit but not the one http://www.noritsuna.jp/download/NyARToolkitAndroid-2.0.1-forSDKr3.zip am trying to install it in a new workspace.

  • Robert
  • 2010年02月11日 22:44

hi
I Use eclipse 3.5
android 1.5 on phone and am working to that, in the code but have up to android 2.x on my pc

? when you import the zip NyARToolkitAndroid-2.0.1-forSDKr3.zip should you get 4 new projects coming up or just 1 or 2?
I get NyARToolKit,, NyARToolKit.utils.jogl,, NyARToolKitAndroid,, NyARToolKitAndroid-2.0_core

the vrs that i have working as only 2 (NyARToolKitAndroid and NyARToolKitAndroid-2.0_core)

  • 2010年02月11日 23:10

hi Robert
I use the same tools as you have.. the http://www.noritsuna.jp/download/NyARToolkitAndroid-2.0.1-forSDKr3.zip works on android 1.1, i just got it work yesterday.. now my problem is how to get the socket camera on..currently i'm using the webcam as a camera for my emulator but it cannot work.. do you know how?

  • rassel
  • 2010年02月12日 13:06

anonymous :
when you import the zip NyARToolkitAndroid-2.0.1-forSDKr3.zip with eclipse you should get 2 projects, the nyartoolkitandroid and nyartoolkitandroid-2.0_core..

  • rassel
  • 2010年02月12日 13:08

robert :
i have the same tools as you have.
download/NyARToolkitAndroid-2.0.1-forSDKr3.zip works on android 1.1,i get it work yesterday,now my problem is how to get my webcam work as a camera on my emulator.. do you know how?

  • 2010年02月12日 13:11

finally i get it works..
for the camera i just installed the jmf and then copying jmvfw.dll to the jmf lib.. editing the xml to use the socket camera, running the webcambroadcaster and it's working..
thanks.. looking forward for any improvement..

  • rassel
  • 2010年02月14日 11:57

Hi, Does any one improved the speed of the nyARToolkit ? Pls let me know, that would really help in my final year project.

Thank you.
LN.

  • FYP Student
  • 2010年02月16日 00:23

Hi All,

NyARToolkit for Android will become official http://en.sourceforge.jp/projects/nyartoolkit/ project at next month.
Please look up this project page.

  • noritsuna
  • 2010年02月16日 00:45

hi noritsuna..
do you have nyartoolkit that runs in android 1.6? i've tried the NyARToolkitAndroid-2.0.1-forSDKr3.zip but it only runs in 1.1..
can u help me?

  • rassel
  • 2010年02月22日 16:19

Hi rassel,

Please look at official "NyARToolkit for Android" site.

NyARToolkit for Android:
http://sourceforge.jp/projects/nyartoolkit-and

It is maintained here.

  • noritsuna
  • 2010年02月22日 16:39

hello,
I downloaded the NyARToolkitAndroid-2.0.1-forSDKr3 toolkit and created 2 new android projects for them .
the problem is that iam lost with the code, i dont know how to get it working with my webcam on emulator...can anyone help please?
thank you in advance :)

  • Ghada
  • 2010年02月25日 08:03

Hi,

There is a great delay in processing. Anyone have some suggestion on how to solve this ?

Thanks.
John

  • John
  • 2010年02月26日 13:30

True John,

Probabily because of the camera calls written in Java may not be so optimal...Try NDK!

Manu.

  • Manu
  • 2010年02月26日 18:12

hi
I think I did all for test your source
->
1. installed the jmf and then copying jmvfw.dll to the jmf lib.
2. editing the xml to use the socket camera,
3. running the webcambroadcaster and it's working..

like someone above did

but I got black screen.....

In logcat
I got some error
ERROR/GLLogger(56): couldn't load library (Cannot find library)

ERROR/MemoryHeapBase(56): error opening /dev/pmem_gpu1: No such file or directory

ERROR/Camera(265)

How can I fix it ?


  • sang
  • 2010年03月03日 14:39

hi
I got small improvement in test.
after your activity open in emulator,
there are no errors in logcat.
also socket camera start well.
and I checked some message about
AR draw ...

but in emulator screen,
just only endless
"loading" message show
over and over


I am not sure this result I got is right
Should i add some code for camera
preview?

  • sang
  • 2010年03月04日 11:30

Hi,

If I were to change the marker for detection, I need to change only the patt.hiro and marker.jpg rite?

Pls help.

Thanks.

  • Ashok
  • 2010年03月04日 13:32

Hi there

I have installed Android 2.1 platform and trying to run NyARToolkit in Eclipse Galileo. But unfortunately I could not. Is it possible to run NyARToolkitAndroid-2.0.1-forSDKr3 in this platform? If yes, then which AVD I should use?

Thanks in advance.

  • eishita
  • 2010年03月08日 12:10

Hi im trying to run it on a htc hero android version 1.5. It starts the NyARToolkitAndroidActivity but the screen stays black. Im using the AttachedCamera but it stays black. How can I get the camera to work?

  • jtool
  • 2010年03月16日 21:27

sang : what android version are u using?\
eishita : i experiencing the same problem too on android 2.1 try using and 1.1

  • 2010年03月17日 21:52

sang : what android version are u using?\
eishita : i experiencing the same problem too on android 2.1 try using and 1.1

  • rassel
  • 2010年03月17日 23:20

how do u export two project nyartoolkitandroid and nyartoolkitforandroid into one apk?? does it run separately?

  • bart
  • 2010年03月18日 12:25

Hello, Noritsua, how far have you gotten with NDK version of NyArToolkit for Android?

  • Henri
  • 2010年04月24日 17:29

Hi Henri,

NDK version is discussed by Official development team.

Please wait!

NyARToolkit for Android Official development team:
http://en.sourceforge.jp/projects/nyartoolkit

  • noritsuna
  • 2010年04月24日 17:44

Hi. Noritsua, How about take picture from NyARToolkit HT03ACamera?
I hope AR can take picture from android handset(use camera takePicture API), no use socket function take picture.
Thanks for your support.

  • Richard
  • 2010年07月22日 10:26

Hi Richard,

Sorry, I do non know it.

Please check NyARToolkit for Android Project site.
http://sourceforge.jp/projects/nyartoolkit-and/

HT03ACamera source code:
http://git.sourceforge.jp/view?p=nyartoolkit-and/nyartoolkit-and.git;a=blob;f=src/jp/androidgroup/nyartoolkit/hardware/HT03ACamera.java;h=682afd444992920bd8d6d218c99a1e09d445f1c9;hb=refs/heads/android-1.6

  • noritsuna
  • 2010年07月22日 10:44

Hi. Noritsua, excuse me ,if i wanna change the marker,where should i edit?
I already have the new marker .

And,if i want it can capture multiple marker how should i do,i cant find out form the simple.

  • Louis
  • 2010年07月27日 18:07

Hi Louis

> if i wanna change the marker...

marker's path is

res/raw/patt.hiro


> if i want it can capture multiple marker ...

Please use the official version.
It is supported multiple marker!

http://sourceforge.jp/projects/nyartoolkit-and

  • noritsuna
  • 2010年07月27日 19:44

thank you,
I have changed the version to "2010-06-28".
but it still cant display multiple model at the same time.

  • Louis
  • 2010年07月27日 23:37

Hi,

I'm starting in programing Android, so I follow all tutorial instructions to run NyARToolkit in Android. But I've obtained some errors, and I don't know why. Let me explain what i'm doing:

- I downloaded Eclipse, Android SDK, ...
- I imported the last version of NyARToolkit for Android (NyARToolkitAndroid-1.0.1.20080522)
- And, without any change, I obtained two errors:
1.- "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project"
2.- "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files"

Well, Why did I obtained errors? I didn't make any change. It supposed that must to run well ¿not?

Please, Can anyone help me?

Thx

  • Victor
  • 2010年09月28日 22:16

I m new to java and android, is it posible to load other 3d model format than .mqo, like .obj .dae ?

  • teonicel
  • 2010年09月29日 17:50

Hi Victor, teonicel,

Please check the current version source code. :-)
http://sourceforge.jp/projects/nyartoolkit-and


  • noritsuna
  • 2010年09月29日 17:54

Hi, I downloaded the two versions is in that folder and compile without errors. The problem is that when run on the phone, the camera turns on but the screen goes black, does anyone know why? I have a Motorola Milestone 2.1
The "apk" I got version 1.1 it does work for me, but the code gave errors, so that I could not compile.

  • Victor
  • 2010年10月04日 17:40

Hi Victor,

Sorry, I don't know it.

Please ask this project members.
Issue Form:
http://sourceforge.jp/ticket/newticket.php?group_id=4953&display_mode=simple

  • noritsuna
  • 2010年10月05日 15:35

Thx, I put the ticket, now i'm waiting the answer. but I have no interest in a concrete version, only need that the code can compile without errors and the "apk" run on the phone. Can you provide me the source code?

Regards

  • victor
  • 2010年10月08日 17:25

Hi again. You were right, they answered me suggesting I would change 2 things in the original code:

in NyARToolkitAndroidActivity.java.

- private boolean mTranslucentBackground = true;
+ private boolean mTranslucentBackground = false;

in res/values/strings.xml.

- jp.androidgroup.nyartoolkit.hardware.HT03ACamera
+ jp.androidgroup.nyartoolkit.hardware.UVCCamera


I tried it and it runs very well now. Thanks for your advice.

  • victor
  • 2010年10月18日 17:53
comment form
comment form
Creative Commons License
This weblog is licensed under a Creative Commons License.