Archive for the 'Android' Category

Nexus Android Calendar

March 13, 2010


The Nexus One calendar synchronizes with your Gmail calendar well. You must have a calendar in Gmail (see below) and the two sync together provided you have set it up in Nexus ‘Geberal Sync Settings’ – this is under the App called ‘Settings’ – easy.


If you add a google maps URL, eg http://maps.google.co.uk/maps?q=80+Edgware+Road in the where section of the calendar then you can click this in the Nexus and up comes google maps magically on the PHONE 🙂

Advertisements

Android OpenGL ES

February 17, 2010



This program draws a cube in triangles (ES only draws triangles!) according to defined vertices v0, v1, v2 etc. The vertices are colored by ‘colors array’ and then triangles are drawn via the ‘byte indices’ array. Hope this code and pics are self explanatory 🙂
source code – you will have to email me for the zip file 3d_3.zip
class Cube
{
public Cube()
{
int one = 0x10000;
int vertices[] = { // vertices draw a cube

-one, -one, -one, //v0
one, -one, -one, // v1
one, one, -one, // v2
-one, one, -one, // v3
-one, -one, one, // v4
one, -one, one, // v5
one, one, one, // v6
-one, one, one, // v7
};
int colors[] = {
0, 0, 0, one, //v0 black – red, green, blue, alpha
one, 0, 0, one, //v1 red
one, one, 0, one, //v2 yellow
0, one, 0, one, //v3 green
0, 0, one, one, // v4 blue
one, 0, one, one, // v5 magenta
one, one, one, one, // v6 white
0, one, one, one, // v7 aqua
};

byte indices[] = {
0, 4, 5, 0, 5, 1, // Draws v0 then v4 then v5 (triangles) etc
1, 5, 6, 1, 6, 2,
2, 6, 7, 2, 7, 3,
3, 7, 4, 3, 4, 0,
4, 7, 6, 4, 6, 5,
3, 0, 1, 3, 1, 2
};