Luca Zanini
  • Home
    • Astronomy
    • Android
    • Java
    • Lotus
  • About me
  • New Astronomy category in this blog

    Nov 28, 2020

    —

    by

    Luca Zanini
    in Astronomy

    In the last 4 years I have not used this blog but now I want to resume publishing the photos taken with my new telescope.Astronomy has been a my hobby since I was a child, unfortunately I had to stop for many years and now I would like to start observing the sky again. On…

    Read more: New Astronomy category in this blog

  • Saving and reading files in the internal storage

    Nov 27, 2016

    —

    by

    Luca Zanini
    in Android

    You can save and read files in the internal storage as private files which only your app can see except for other apps with root privileges.

    Read more: Saving and reading files in the internal storage

  • The class LruCache to manage a cache of bitmap objects

    Nov 22, 2015

    —

    by

    Luca Zanini
    in Android

    The intensive use of many images in an app can create difficulties to the responsiveness and to memory, shown by warnings like ANR (Application Not Responding) or errors like OutOfMemoryError.

    Read more: The class LruCache to manage a cache of bitmap objects

  • A List with a fixed size

    Nov 15, 2015

    —

    by

    Luca Zanini
    in Java

    There isn’t a class that extends List for which you can set a limit on its size and that it behaves like a Queue object if you add an item beyond its fixed size.

    Read more: A List with a fixed size

  • Avoiding too frequent updates to the views

    Nov 1, 2015

    —

    by

    Luca Zanini
    in Android

    In Android in order to avoid to do too work in the main thread, most of the operations should be carried out in a secondary thread or a class that extends AsyncTask; then the final results are reported in some view to be shown to the user using Activity.runOnUiThread(Runnable) or View.post(Runnable) (see Processes and Threads)…

    Read more: Avoiding too frequent updates to the views

  • Golden Rolly

    Oct 18, 2015

    —

    by

    Luca Zanini
    in Android

    I published an app in Google Play Store named Golden Rolly, it is a game of the category puzzle and you can find a short video presentation here.

    Read more: Golden Rolly

  • Resetting the preferences on first launch of an app

    Aug 30, 2015

    —

    by

    Luca Zanini
    in Android

    If you want to reset or change preferences of an app at the first start here is an example of code you can put in an event as onCreate of the main activity:

    Read more: Resetting the preferences on first launch of an app

  • Restoring complex objects at restart of an activity

    Jul 28, 2014

    —

    by

    Luca Zanini
    in Android

    In an android app an activity is created and then destroyed, for example when the user open another activity or when the user presses the back button, later the user opens again the same activity that is is recreated using the data saved before the earlier destruction of the activity. The data are saved in…

    Read more: Restoring complex objects at restart of an activity

  • Stopping the threads

    May 24, 2014

    —

    by

    Luca Zanini
    in Java

    Starting a thread is very easy in java, after you create it you need to call the method start(), for example: Thread myThread = new Thread(new MyRunnable()); myThread.start(); where MyRunnable is a class implementing the Runnable interface overidden the method run().

    Read more: Stopping the threads

  • List of the sensors in a device

    May 18, 2014

    —

    by

    Luca Zanini
    in Android

    In December 2012 I wrote a post about an app that displays the sensor list in an android device, now after about a year and a half the API 19 have new sensor types and methods and I thought to update the app.

    Read more: List of the sensors in a device

←Previous Page Next Page→
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.