Re: [Vala] Vala to Android - Cairo

2013-04-01 Thread Tal Hadad
Very good results.
But why the Android device is needed to be rooted?

And is it possible to use OpenGLES in Vala there?

Tal

 From: tarn...@tarnyko.net
 To: vala-list@gnome.org
 Date: Mon, 1 Apr 2013 06:10:40 +0200
 Subject: Re: [Vala] Vala to Android - Cairo
 
 Hi people, 
 
 Last message from myself on this thread, just to let you know that I made a 
 tutorial for using Cairo on Android - from Vala : 
 
 http://www.tarnyko.net/en/?q=node/26 
 
 So we can now draw shapes, text, images... and all sort of nice things on 
 Android's screen from Vala code. 
 
 More interesting stuff in this style will come later, working on this. 
 
 Regards,
 Tarnyko
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list
  
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala to Android - Cairo

2013-04-01 Thread tarnyko
Hi Tal, thanks for your interest, 

Tal Hadad writes: 


Very good results.
But why the Android device is needed to be rooted? 

Well, during my tutorial, I speed up things by directly copying the native 
binary deep in the phone's internal filesystem ; I think you are not allowed 
to do that with an unrooted phone. 

A solution -not requiring root- would be to regenerate and reinstall the 
whole APK each time you recompile stuff. But the tutorial would have been a 
hell longer (explanations on SDK, APK, a.s.o.) so I decided to concentrate 
on core Vala things.


And is it possible to use OpenGLES in Vala there? 



Potentially, yes. By using the SDL Android port, which has support for ES 
1.1 and 2.0 (see http://bugzilla.libsdl.org/show_bug.cgi?id=1291). 

Vala has already a SDL VAPI, we just need to recompile libs and write some 
glue code, like I did here for Cairo. I'm just too busy to do this right 
now. 

Tal 


From: tarn...@tarnyko.net
To: vala-list@gnome.org
Date: Mon, 1 Apr 2013 06:10:40 +0200
Subject: Re: [Vala] Vala to Android - Cairo 

Hi people,  

Last message from myself on this thread, just to let you know that I made a 
tutorial for using Cairo on Android - from Vala :  

http://www.tarnyko.net/en/?q=node/26  

So we can now draw shapes, text, images... and all sort of nice things on 
Android's screen from Vala code.  

More interesting stuff in this style will come later, working on this.  


Regards,
Tarnyko
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list
 		 	   		  
___

vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala to Android - Cairo

2013-03-31 Thread tarnyko
Hi people, 

Last message from myself on this thread, just to let you know that I made a 
tutorial for using Cairo on Android - from Vala : 

http://www.tarnyko.net/en/?q=node/26 

So we can now draw shapes, text, images... and all sort of nice things on 
Android's screen from Vala code. 

More interesting stuff in this style will come later, working on this. 


Regards,
Tarnyko
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala to Android - Cairo

2013-03-26 Thread tarnyko
OK, I'm posting it mostly for the record, please note it is a long mail. 
Feel free to ask questions. Here we go. 

I found some pre-compiled versions of Cairo for Android on the Internet ; 
none of them was complete (with dependencies) nor usable with agcc/valac. 

So, after struggling a bit... 


Cairo 1.10.2 for Android :
http://www.tarnyko.net/repo/cairo-1.10.2-android-(TARNYKO).tar.bz2 


Here is a stand-alone Vala sample :
http://www.tarnyko.net/repo/cairo.vala
to be compiled with :
valac --cc=agcc --pkg cairo -o cairo cairo.vala --Xcc=-lpixman-1 
--Xcc=-lpng15 

It blits a image.png file with some overlay text. Should run fine on an 
Android phone. 


Next step is to display this stuff to Android's screen, and here we have
a problem ; by design, the OS doesn't allow native code to draw to screen.
Any data should be passed between a native library (*.so) and a running Java 
app. So I will use AndroidBitmapInfo from JNI as a vector. 


I've prepared a demo project :
http://www.tarnyko.net/repo/cairo-android-vala.tar.bz2
contains :
android.vapi : Android VAPI (dummy)
cairo-android.vala : Vala source
cairo-android.glue.c : C Android Glue 


should be compiled with :
valac --cc=agcc -X -shared --pkg cairo --pkg android --vapidir . 
cairo-android.vala cairo-android.glue.c -o libcairo-android.so 
--Xcc=-lpixman-1 --Xcc=-lpng15 --Xcc=-ljnigraphics 

and drops a libcairo-android.so file which you can call from Java : 


static { System.loadLibrary(cairo-android); }
drawPNG(bmp); 


Regards,
Tarnyko
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list