I’ve finally got an Android Wear device and It’s the Huawei Watch. At first I wanted the Moto360 2nd gen (for the larger screen) but I was unable to buy it from motorola.com and after several attempts I ended up with a paid order but no watch (money is deposited somewhere and should return after once month of the “purchase”). I’m glad I didn’t end up with a “flat tire” and a pixelated ambient display!
So anyway, I went back to my old app Hexscreen and extracted some code to a separate module then used it in a new Android Wear application and ended up with this nice and interactive test 🙂
A while ago I made a very small app around the idea of selecting an image, then revealing its details by touching the screen and moving your finger and once you’re happy with the result, you can share the photo to other apps.
Yesterday I published a new version where I changed the design and added the ability for users to sign in\register using a Google account then share what’s being created inside the app so other users can view and like.
In this post I’m going to share some technical details that I found interesting while improving the app and implementing the backend.
I wanted to make something similar to the ripple effect but since product-grade libraries for that specific purpose exist I just ended up experimenting with OpenGL ES2 and here’s the result:
Why did I go with OpenGL instead of a canvas? because shaders :D, with a fragment shader you can get various effects. add post processing and you’ll get even more effects! Here I tried something really simple as shown in the video above.
Sometime ago after I finished my tutorials for Android offline map app I spent some time adding more features to the simple app, I guess I should share the code since many of those features are expected from any map application.
The post here won’t contain detailed explanation about how each feature is implemented since each feature might require it’s own post. Anyway if you’ve been reading my previous tutorials everything here should be straightforward and easy to understand, consider the source code provided here as some sort of raw data that someone might benefit from 🙂 .
This code is built upon the offline version of the app, so it doesn’t have web tiles support and the mapView cannot be created in xml (these can be changed easily by following the previous two tutorials).
The code isn’t perfect either, it does the job though 🙂 .
Here’s the features list:
- Points of interest (POI).
- GPS tracking service.
- Location sharing.
- Map selection at runtime.
- Changing tiles size at runtime.
- Importing\Exporting points and tracks.
- Source code.
The post will contain lots of images so please be cautious :).
Before I talk too much, here see the results for yourself, this is the web version : SpringLab Web Version.
Reminds you of World of Goo 😀 ?
I came across this tutorial, from which I learned this lovely vector equation:
F = -k(|x|-d)(x/|x|) - bv
I applied it to 2D springs and it gave amazing results especially when Read more…
So I again went playing with OpenGL ES 2 on Android, this time I added clouds to the terrain:
Not only that but I also learned new things about OpenGL ES 2 and fixed some deadly bugs in my previous code and reorganized the code in a better way.
Here are some screenshots showing the results of using different textures and different Read more…
Hi :), welcome to the 7th part of my tutorial on how to create offline\online map app for android.
- Series aim.
- Theory you need to know.
- App design.
- Writing a TilesManager.
- Writing a TilesProvider.
- Seeing results with MapView.
- Adding web support
- Creating MapView in XML
So once again it’s an unplanned tutorial and it’s about maps 😀 .
The thing is that I got a number of comments asking about how to create the mapView in XML instead of creating it in java code, what we’ll achieve here is:
- Make the mapView creatable from XML.
- Assign a zoom level to the mapView in XML.
- Adding a position marker (drawable) to the mapView from XML.
- Add ZoomControls to the layout containing the mapView in XML.
Here’s how the final result should look like:
And just a note before you continue reading: you can add the mapView in XML like any other view, one difference though is that you cannot rely on using wrap_content in the view, since there’s nothing to wrap (something like text in a button for example) but this is not end of the world, you can either using fill_parent or use 0dip with android:layout_weight, only then the mapView will play nicely with other views :).
So either use a RelativeLayout and put your mapView and other views in it, or use LinearLayout and supply weight values for your views.
So if you’re still reading this please download the source code (along with the empty database) from MapApp 6 : Web Support since I’ll be building on the code from that tutorial. Just please remember to put the database World.sqlitedb in the folder /mapapp/ on the sdcard.
The steps we will have to do are Read more…