Differences

This shows you the differences between two versions of the page.

Link to this comparison view

osp:lectures:lecture-native-apps [2016/10/05 11:41]
laura.gheorghe created
osp:lectures:lecture-native-apps [2017/01/22 13:16] (current)
laura.ruse [Lecture]
Line 1: Line 1:
-===== 06 - Android Native Activities =====+===== 07 - Android Native Activities =====
  
   * Description: ​   * Description: ​
Line 8: Line 8:
  
  
-  *{{:​osp:​lectures:​lecture-6.pdf | Lecture ​Slides}}+  *{{:​osp:​lectures:​lecture-native-app.pdf | Slides}} 
 +  *{{:​osp:​lectures:​7.native_activities_notes.pdf | Notes}}
  
-{{url>​http://​ocw.cs.pub.ro/​courses/​_media/​osp/​lectures/​lecture-6.pdf}}+{{url>​http://​ocw.cs.pub.ro/​courses/​_media/​osp/​lectures/​lecture-native-app.pdf}}
 ==== Practical ==== ==== Practical ====
  
Line 19: Line 20:
 === Files === === Files ===
  
-{{:​osp:​lectures:​lab6.zip|}}+{{:​osp:​lectures:​native-activity.zip|}} ​ and {{:​osp:​lectures:​opengl-activity.zip|}} 
  
 === Task 1 - Create a Native Activity (1p) === === Task 1 - Create a Native Activity (1p) ===
  
-Import the native-application project from the lab archive.+Import the native-activity ​application project from the first lab archive.
  
 Edit AndroidManifest.xml. Verify that your activity is declared. Edit AndroidManifest.xml. Verify that your activity is declared.
Line 153: Line 155:
 === Task 4 - OpenGL (1p) === === Task 4 - OpenGL (1p) ===
  
-Import the opengl-native project from the lab archive.+Import the opengl-native project from the second ​lab archive.
  
 Look over the code. Like with an Android Java application,​ you have to first create an EGL context in which to draw and then call the drawing functions. Unlike the Java version, there is no renderer class, so you can call the draw functions at any time. In this case they are drawn in a loop, after processing events. It is usually advisable to limit the frame rate to 30 or 60, since otherwise the application might drain a lot of battery. The rest of the code is identical to the one used in the previous session. Look over the code. Like with an Android Java application,​ you have to first create an EGL context in which to draw and then call the drawing functions. Unlike the Java version, there is no renderer class, so you can call the draw functions at any time. In this case they are drawn in a loop, after processing events. It is usually advisable to limit the frame rate to 30 or 60, since otherwise the application might drain a lot of battery. The rest of the code is identical to the one used in the previous session.
Line 187: Line 189:
             event, num_events)             event, num_events)
 </​code>​ </​code>​
-Event should be a pointer towards ​an ASensorEvent structure if num_events is 1 or an ASensorEvent array, if num_events is more than 1. ASensorEventQueue_getEvents returns the number of events it read. The data read from the accelerometer will be in the accelerometer structure inside the event. Use this data to rotate the camera on the rx direction.+Event should be an ASensorEvent structure if num_events is 1 or an ASensorEvent array, if num_events is more than 1. ASensorEventQueue_getEvents returns the number of events it read. Pass to this function a reference to the event. The data read from the accelerometer will be in the accelerometer structure inside the event (hint: acceleration). Use this data to rotate the camera on the rx direction.
osp/lectures/lecture-native-apps.1475656916.txt.gz · Last modified: 2016/10/05 11:41 by laura.gheorghe
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0