Skip to main content

Posts

How to keep objects when activity is configured

When activity is reconfigured(e.g. rotating the screen), by default whole activity with its objects will be destoyed and recreated, because Android may need alternative resources to match current screen size. Related explanation on developer.android.com site: Caution: Your activity will be destroyed and recreated each time the user rotates the screen. When the screen changes orientation, the system destroys and recreates the foreground activity because the screen configuration has changed and your activity might need to load alternative resources (such as the layout).

Why shouldn't static variables be used as global variables in Android development

For mobile devices with small memories, memory usage and care of applications is essential. If an application uses images, it can easily result a memory leak if they cannot be collected by garbage collector. A reason why GB couldn't collect unused objects is that those objects refers to a static variable. So, if you are setting a property of a local variable with a static one, you need to be double careful.

Pressing ActionBarDrawerToggle doesn't Open Navigation Drawer Menu

I am implementing an application with fragments + main activity.  The extended activity class is android.app.Activity . I have aimed to use ActionBarSherlock to specialize the action bar. So, I have changed the inherited classes of main activity and fragment classes. Old Version: Main Activity -extends- Activity Fragments -extends- Fragment New Version: Main Activity -extends- SherlockFragmentActivity Fragments -extends- SherlockFragment

My First Mobile Game: Bazaar

I have published my first mobile game today. Its name is Bazaar. As may be seen from the name, it has a mediterranean style. Its game music too :) . It is a simple game. But I think it is a good start. Bazaar has basic aspects of knapsack problem. It is that you have a limited size of bag and lots of items. Each item has different size and value. You need to pick items up and fill the basket, such that these items shouldn't space much but value much in contrast. In other words, ratio of should be as high as possible.  As fruits fall down, the user swipes the basket and picks them by following the way explained above. Google Play Services is integrated to it. So, users will be able to compete with other players in the world. They will also be able to gain achievements as they play. Have fun!

Integration of MuPDF Project as a Library into an Android Studio Project

I have needed to use MuPDF library in my android project. After some research, I have seen that there are many integration tutorials but, but integrated projects are developed on Eclipse. For projects on AndroidStudio+Gradle, there is no example. I mean there is no specific example which exactly refers to this issue. So, after achieving my goal, I want to share the steps publicly so that it can be reused by others.

A Way To Monetize Your Kivy Game

While I am building my game, I look for a way to monetize it. This will be my first game, so it is also the first to attempt earning money with an App. I am also not familiar to monetization companies. So, I have done a search to find an appropriate ads network which can be easily integrated with kivy . The first and only company who provides a sdk for kivy is RevMob . I integrated RevMob sdk and tested it. Unfortunately, it doesn't have a good performance and FullScreen Ads crashes. Just links will work. Therefore, RevMob option is not really preferable since ads need to be visually effective. You can also integrate android sdk of any ads network by using pyjnius . In this post, I will show how to use Adbuddiz sdk with kivy.

How to analyse nova logs via logstash

In Elasticsearch family, there is a three that collects, analyses and plots logs, which I found quite beneficial. The three is  Logstash + Elasticsearch + Kibana. Logstash collects logs with various formats and parses them by using a given recipe. then parsed logs are stored into elasticsearch or another selected back-end. After all, using indexes in elasticsearch, Kibana will let you analyse logs in various ways with great visuality. In this post, I will quickly show how to work on openstack-nova logs on an already set up environment.