Archive

Archive for the ‘Programming’ Category

Dear Backender (A Rude Open Letter)

28/07/2015 Leave a comment

Dear backend developer…


Backend Developer

This post is the first of a series about the struggle I as an Android applications developer must endure when working with backend developers, designers or other people involved in building a mobile application.

It will contain some points you might not be aware of and some things you can do to make the mobile application developer’s life easier or at the very least not make it harder than it should.

Disclaimer: My personal opinions and preferences might be included in these articles and you’re welcome to correct any incorrect points in the comments below.

If you are a mobile application developer you might also find something useful here especially if you’re just beginning.

So to start, this first article is dedicated to people who write APIs for mobile applications, You the backender and me the app developer are starting from scratch and no previous API exists.

Read more…

Genetic Algorithms Lab

27/09/2014 Leave a comment

Genetic Lab

 

So a few years ago I did a project for the Genetic Algorithms assignment at college. My idea was to have tiny multi-cell organisms that have a simple goal: travel as far as possible! maybe to find new resources or escape from predators, you pick one 🙂
So the fitness of a creature is measured by how far it can go during its life span.

The creatures will start with random moving cells and evolve to more organized creatures with organized movements.

Please watch the video before reading. If the video failed to make you interested then I doubt that the text would succeed. You can also download the executable and the source code available at the end of this post.

 

Read more…

Hexscreen v1.2

08/10/2013 Leave a comment

Hello :D, Hexscreen v1.2 is now available!

I fixed some bugs and added some more features:

  • Advanced color picker: the old color picker was very simple, it only allowed the user to select a hue. The new one allows the user to customize the colors to the max!.
  • Higher quality image support: the older version limits the maximum image width (or height) to 512 pixels. You can now choose images up to 1024 pixels.
  • Added a file picker: I made a mistake when I assumed that all Android users have a file browser installed! To deal with that I implemented a simple file picker (and I enjoyed it) and packaged it with the app. Now my Hex File Picker will be listed with any other file browser available on the phone when the user wants to pick a style from a file.
  • Improved screen positioning: in this version the hex screen will always be centered in your screen, so hopefully no more empty areas are left.


Issues with some devices:

For some reason some devices couldn’t compile the shaders of the app. No shaders means no app!.
I did modify the shaders for this version and hopefully they will work on those devices too, one problem is that I can’t know if the app is working fine, I can only know that the app is not working well (using ACRA).

So if you have any of those devices please feel free to try the app and tell me of the results:

  • LG Google Nexus 4 (Android 4.3)
  • Huawei MediaPad 7 Lite (Android 4.0.3)
  • Asus Google Nexus 7 (Android 4.3)
  • Samsung GT-N7000 (Android 2.3.4)
  • Samsung GT-N7100 (Android 4.1.2)
  • Samsung GT-I9100 (Android 4.1.2)
  • HTC One X (Android 4.2.2)


Get it!:

you can download the app freely from your favorite market:

Hexscreen on Google Play

Hexscreen on Google Play

Hexscreen on Amazon.com

Hexscreen on SlideMe Market

The app is also coming soon on Opera market.That’s it I guess :D, If you have any questions or comments I’ll be happy to answer 🙂 .

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 front camera app

21/10/2012 3 comments

So my friend has a Samsung Galaxy SII, unfortunately the back camera isn’t working anymore, the front one is working and he was able to test it using a built in testing utility that only shows a preview with no photo taking functionality.

The problem with most (all maybe?) camera apps is that they first check the back camera and then crash since the camera isn’t working!. Using an old camera project of mine I removed most of the features (flash, focus, geo tagging, saving images to database with encryption) and changed the app to use the front camera using Camera.Open(1), so now he can use the front camera :).

The reason I’m posting this is that the app might help if someone has a similar problem.

I found some apps that only use the front camera but some of them were laggy and I already had my own app half ready :D.

Here’s the apk with the source Read more…

Categories: Android, Programming

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: , ,