Archive

Posts Tagged ‘Android’

Android Wear Open GL ES 2 Test

22/02/2016 Leave a comment

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 🙂

Read more…

Split v2.0 – Going Online

30/12/2015 1 comment

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.

 

Read more…

Gl Button

28/12/2014 Leave a comment

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.

Read more…

Categories: Android, My Thoughts, OpenGL Tags: ,

Fuchs Maps

05/03/2013 43 comments

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:

The post will contain lots of images so please be cautious :).

Read more…

Categories: Android, Maps Tags: , ,

Simple Spring Physics

02/03/2013 8 comments

A few weeks ago (during exams period 😛 ) I was playing with spring physics, it turned out to be easy to implement and the results were cool enough for me to write a demo in Android, Microsoft XNA, and Javascript :D.

SpringLab img

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…

Android Terrain Test 2 : Clouds

26/02/2013 11 comments

So I again went playing with OpenGL ES 2 on Android, this time I added clouds to the terrain:

Clouds_Screenshot

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…

MapApp7 : Creating MapView in XML

26/02/2013 15 comments

Hi :), welcome to the 7th part of my tutorial on how to create offline\online map app for android.

Series outline:

______________________________________

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:

MapApp with ZoomControls

MapApp with ZoomControls



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…

Categories: Android, Maps, Programming Tags: , ,

Android terrain test

19/10/2012 18 comments

Hello :), a while ago I decided to learn OpenGL ES 2.0 in Android, so I decided to make a simple terrain, and now I want to share my thoughts about this experience :D.

Edit: after reading this post please take a look at Android Terrain Test 2 : Clouds where the code is better and bugs are fixed (clouds were added too 😛 ).

Terrain in landscape mode


  1. Difficulties
  2. Video
  3. Download apk and source
  4. WebGL Version!
  5. Helpful tutorials
  6. notes



Read more…

MapApp6 : Web support

16/08/2012 19 comments

Hello, welcome to the 6th part of my tutorial on how to create an offline? map app without using Google™ API, okay this time it’s no longer offline :D! now the app will be able to download tiles from the internet :D!.

Series outline:

______________________________________

At first I planned on writing some basic tips about web tiles server support but then I realized that implementing web support needs some work and code organizing since multi threading becomes a must!. You cannot wait for the tiles to be downloaded in the UI thread!.

We will assume that you have a running tiles server that provides you with tiles you specify using a custom url like this:

http://myserver.com/?x=1&y=3&z=0
or

When we want a specific tile we first search if we have it in our memory cache, if we don’t then we search in the database, if we fail to find it then we download it from the internet.
It’s kind of similar to multi cache levels in a cpu, if one level fails it gets the requested data from the next level, when data found in a certain level all lower levels save a copy of the data since it’s highly likely to be asked for the same data in the near future.
In our case when you don’t have a tile in memory or in database you get it from the web server and then save it in the database and keep it in memory for later use.

We’ve already implemented the first two levels (Memory & database) in the tutorial part 4, the TilesProvider class covered them both. but we didn’t have any threading manipulation, this time we have to be very careful about threading stuff. We will implement new classes and modify some of the old ones, the changed lines in existing classes will be highlighted in grey. Also note that if you’re using Eclipse as your IDE you can always count on the keyboard shortcut Ctrl+Shift+O to automatically import the right packages.


We will add three source files to our project in a new package called com.mapapp.tileManagement.web

Let’s first implement the class TileDownloadTask, this class handles Read more…

Categories: Android, Maps, Programming Tags: , ,

MapApp5 : MapView and Activity

06/04/2012 64 comments

Welcome to the fifth and final part of my tutorial on how to create a map app for Android without using Google™ APIs :).

Series outline:

______________________________________

So up until now we didn’t see any results :(, this is where everything changes :D.

In this part we’ll write three classes:

MapView: a custom view to render and manipulate the map.

MapAppActivity: the main (and only) activity for the app, mainly creates the MapView and handles activity state changes.

MapViewLocationListener : An extended LocationListener that knows how to deal with a MapView.


MapView:

First thing you should know about this view is Read more…

Categories: Android, Maps, Programming Tags: , ,