Tuesday, 26 May 2015

Orientation Issue with Unity and Moto 360

Another issue i found with the Moto 360 and unity was the orientation this is what the game looks like in Unity


But on the device it looked like this


When i checked my player settings in Unity the orientation was on Portrait. so after some trial and error i found that Landscape left gave me the correct orientation. :)


Just a quick tip the screen size for Moto 360 is 320 x 290 so add these dimensions to the Unity game view.


Running Unity Game on your Android Wear device.


If you followed my previous blogpost you should have a android studio project ready for deployment, and like me if you have already got a device that you would like deploy on then read on.

Step 1: Pair your Android Wear device with your Android Phone

Follow this link to achieve this 


Step 2: Enable Bluetooth Debugging

https://developer.android.com/training/wearables/apps/creating.html and scroll down to Set Up an Android Wear Device if like me you have got a Moto 360 which does not have a usb connection click on this link https://developer.android.com/training/wearables/apps/bt-debugging.html 

Once you have all of that and have your device connected. Go to Android Studio and click on Run and when you get the prompt to select device choose the watch, then be patient as it does take some time for the apk to be uploaded and installed onto the device once it has uploaded and installed you can go on the watch press it once to open the menu and find your game :).

Unity3d to Android Wear!

Ok so finally i have been successful in porting a Unity3d project to a Moto 360!

Step 1: Export the Unity project as a Google Android Project make sure you set your bundle id
e.g. co.uk.mycompany.test 

for the Minimum API Level select Android 4.4 'Kit Kat' (API Level 19)


Step 2: Create a new blank project on Android Studio. (Android Studio -> File -> New -> New Project). Make sure when you fill out the form above the package name is the same as the one you entered in Unity (co.uk.mycompany.test) once that is all set click on Next.


Step 3a: Select the same Minimum API Level and make sure you tick the Wear box! and select the minimum API Level  (Android 4.4 'Kit Kat') then click next


Step 3b: Leave it as it is and press next.




Step 3c: Leave it as it is and press Finish and let the project set itself up.


Step 3d: Then change the view set up to Project.


Step 4: Time to import our Unity Project. File -> New -> Import Module... then choose the directory where you saved the Unity Project in Step 1 then press Next followed by Finish and let the project set itself up.

Step 5: Once it is set up you need to Delete the MainActivity.java file from the wear folder. 
wear -> src -> main -> java -> co.uk.mycompany.test -> MainActivity


Step 6: Copy the unity-classes.jar from the module you imported it will be in 
test -> libs -> unity-classes.jar and paste this into the lib folder for the wear module (wear -> libs ->...)


Step 7: Copy the assets, java, jniLibs folders from the imported Module test -> src -> main -> and paste them into the main folder for the wear module wear -> src -> main -> ... 

If everything is done correctly you should be able to deploy this onto a device or emulator. I will be posting about how to run a game straight onto an android watch in my next post :).

If you want to make any changes to your unity project and then make it wear friendly all you have to do is start from Step 4. But i would suggest deleting the test module first.

I would like to credit technidus but had to amend a few things to make it work fully!

Thursday, 14 May 2015

Lifestyle choice.

Im a Vaper now :)!

I have always enjoyed a shisha here and there not because of the smoking part just the part where you get to do smoke tricks etc.. so then i looked into Vaping and have not looked back! so many different flavours and MODs and all are so good! i am currently vaping on the iStick 50 that i got from moonVapez who are based in Birmingham UK! they have the best flavours too and most importantly the owner encourages customers to try before buy! No one else lets the customer try their products!

So Thumbs up for Vaping and moonVapez. :)

Thursday, 7 May 2015

Developing for the Apple Watch

Apple Watch is poo.

Ok so for the last 2 days i have been working on small prototype games/apps for the Apple Watch and i must say it is an absolute nightmare! the Dev kit (Watchkit) is so limited!! Let me list all the issues i have come across so far.


  • I wanted to have a slider in my game so i can use the value from the slider in the game. You may be thinking thats simple..... O but wait the device cannot recognise any touch gestures except tap. to if i wanted to you a slider i would have to tap the +/- to increase or decrease the value which is not good for games especially when you want to use it for a smooth mechanic. 
  • O wait I'm sorry it does recognise touch gestures but it already has predetermined behaviours for those gestures!!! leaving the developer with only ONE gesture to work with - TAP. 
  • "O but wait Abdullah on the ad i am sure i saw a smooth animation of the maps being zoomed in etc." well they achieve this via the Digital crown which again developers have no access to! it can be used to scroll up and down when required! but cannot retrieve the value from it. (But i will be looking into a hack version where you can retrieve a value).
  • Next was i wanted to add a 2x2 grid on the screen so i can place 4 buttons inside the grid to create a small game but nope the interface does not allow me to Align buttons in a group also we cannot add buttons/sliders/groups etc programmatically. 
So after 2 days i have had 1 integration of the Apple Watch into one of my games where i can use the watch to turn an object on screen. but I'm not entirely happy with that either. AND finally every 5th/6th time i run on the simulator it hangs on the spinner. so i have to close everything and open again!

On the plus side it was quite easy to set up the Watchkit with Unity. and send messages to Unity code. :)

Theres my little rant on the Apple Watch, maybe i will be happier when i can get a hacky way to get the behaviour i want! 

Just goes to prove Apple as an organisation do not care about developers or users they just care about making money!