@agatestudio
@agatestudio
Unity Android
Rio
Knight
Agate Studio
Sanrio Hernanto
@agatestudio@agatestudio@agatestudio@agatestudio
Extending Unity Functionality using Java Android
@agatestudio@agatestudio@agatestudio@agatestudio
Overview
• Extending Unity via Android Plug-in
– Creating Unity Android P...
@agatestudio@agatestudio@agatestudio@agatestudio
Creating Unity Android Plug-in
• Pre-requisite
– Eclipse
– Android SDK
Create New Android Application Project
Create New Android Application Project
Create New Android Application Project
Add Unity Library to Project
Add Unity Library to Project
Create Your Own Class
Create Your Own Class
Create Your Own Class
Export Your Project
Export Your Project
Export Your Project
Put your JAR file as Unity Android Plugins
@agatestudio@agatestudio@agatestudio@agatestudio
Java – Unity Communication
• Java to Unity
– Access to Unity Activity
– S...
@agatestudio@agatestudio@agatestudio@agatestudio
Java to Unity
@agatestudio@agatestudio@agatestudio@agatestudio
Java to Unity – Unity Send Message
@agatestudio@agatestudio@agatestudio@agatestudio
Unity to Java - AndroidJavaClass
• Unity C#
• Java
@agatestudio@agatestudio@agatestudio@agatestudio
Unity to Java - AndroidJavaObject
• Unity C#
• Java
@agatestudio@agatestudio@agatestudio@agatestudio
Result
@agatestudio@agatestudio@agatestudio@agatestudio
Limitation
• Java to Unity cannot receive return value
• Does not extend ...
@agatestudio@agatestudio@agatestudio@agatestudio
Pros & Cons
• Pros
– Simple Plug-in Code & Build
– Edit and Compile Java ...
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Toast
http://developer.android.com/guide/topics/...
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Toast
• Java Toast Code
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Local Notification
http://developer.android.com/...
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Local Notification
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Local Notification
• Java Local Notification Code
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Intent Call
• Intent Call to Open File or Url
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – Intent Call
• Java Intent Call Code
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – WebView
• WebView
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – WebView
• Java WebView Code
@agatestudio@agatestudio@agatestudio@agatestudio
Java Android Usability – ETC
• Push Notification
• Database
• Java Librar...
Source Code
https://dl.dropboxusercontent.com/u/18962743/source.zip
Thank You
Upcoming SlideShare
Loading in …5
×

Unity - Android by Rio

472 views

Published on

Published in: Education, Spiritual, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
472
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Unity - Android by Rio

  1. 1. @agatestudio @agatestudio Unity Android Rio Knight Agate Studio Sanrio Hernanto
  2. 2. @agatestudio@agatestudio@agatestudio@agatestudio Extending Unity Functionality using Java Android
  3. 3. @agatestudio@agatestudio@agatestudio@agatestudio Overview • Extending Unity via Android Plug-in – Creating Unity Android Plug-in – Java – Unity Communication – Limitation – Pros & Cons VS Other Methods • Java Android Usability – Toast – Local Notification – Intent Call – WebView – etc
  4. 4. @agatestudio@agatestudio@agatestudio@agatestudio Creating Unity Android Plug-in • Pre-requisite – Eclipse – Android SDK
  5. 5. Create New Android Application Project
  6. 6. Create New Android Application Project
  7. 7. Create New Android Application Project
  8. 8. Add Unity Library to Project
  9. 9. Add Unity Library to Project
  10. 10. Create Your Own Class
  11. 11. Create Your Own Class
  12. 12. Create Your Own Class
  13. 13. Export Your Project
  14. 14. Export Your Project
  15. 15. Export Your Project
  16. 16. Put your JAR file as Unity Android Plugins
  17. 17. @agatestudio@agatestudio@agatestudio@agatestudio Java – Unity Communication • Java to Unity – Access to Unity Activity – Send Message to Unity • Unity to Java – Access to Java Class – Call Java Function
  18. 18. @agatestudio@agatestudio@agatestudio@agatestudio Java to Unity
  19. 19. @agatestudio@agatestudio@agatestudio@agatestudio Java to Unity – Unity Send Message
  20. 20. @agatestudio@agatestudio@agatestudio@agatestudio Unity to Java - AndroidJavaClass • Unity C# • Java
  21. 21. @agatestudio@agatestudio@agatestudio@agatestudio Unity to Java - AndroidJavaObject • Unity C# • Java
  22. 22. @agatestudio@agatestudio@agatestudio@agatestudio Result
  23. 23. @agatestudio@agatestudio@agatestudio@agatestudio Limitation • Java to Unity cannot receive return value • Does not extend Android Activity Alternative Method • Extending UnityPlayerActivity • Modifying Android Manifest from Unity • Building JAR via Command Prompt • Custom Build.xml
  24. 24. @agatestudio@agatestudio@agatestudio@agatestudio Pros & Cons • Pros – Simple Plug-in Code & Build – Edit and Compile Java and Android Code with full Eclipse Usage – Non Strict Packages (com.something.something) – Does not edit Android Manifest file from Unity • Cons – Does not extend Android Activity directly – Does not edit Android Manifest file
  25. 25. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Toast http://developer.android.com/guide/topics/ui/notifiers/toasts.html
  26. 26. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Toast • Java Toast Code
  27. 27. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Local Notification http://developer.android.com/guide/topics/ui/notifiers/notifications.html
  28. 28. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Local Notification
  29. 29. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Local Notification • Java Local Notification Code
  30. 30. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Intent Call • Intent Call to Open File or Url
  31. 31. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – Intent Call • Java Intent Call Code
  32. 32. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – WebView • WebView
  33. 33. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – WebView • Java WebView Code
  34. 34. @agatestudio@agatestudio@agatestudio@agatestudio Java Android Usability – ETC • Push Notification • Database • Java Library • Anroid Usability using Additional Methods – Services – Widgets
  35. 35. Source Code https://dl.dropboxusercontent.com/u/18962743/source.zip Thank You

×