Robot on a Mission

  • Archive
  • RSS
  • Ask me anything

Episode Reminder - Android App now available!

After months of development finally the EpisodeReminder is out. My first Android App available for public download in the Playstore.

This will be hopefully only the first of many in a series of apps.

So check it out, send me feedback :)

episodereminder banner
https://play.google.com/store/apps/details?id=net.andac.aydin.episodereminder

  • 3 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode

A common pattern is to use the Android Resources to handle constant-values. Best case it avoids unnecessarily bloating up your classes with constants, worst case it avoids duplicates.

Read More

  • 4 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

IllegalStateException when clicking a button in DialogFragment

A quite common error when implementing a DialogFragment with a button in its xml-layout is to use the layout-inflator received in the method createView().

Read More

  • 5 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Howto: Remove Notifications of killed processes

Notifications are combined with services a great way to inform users of running downloads or new available information. Unfortunately they run on the same process as your main application does. So if by any circumstance your application gets killed, your Notifications might break, become obsolete or just confuse through their existence.

Read More

  • 5 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Use ListViewTypes for performance boost in endless lists

To enhance ListView-Performance in endless-lists this repo I created might come in handy:

https://github.com/andacaydin/VersionedListAdapterExample

Read More

  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

HolderPattern: Improving Performance of Listviews even more for endless Lists

Introduction

You can never tune your ListView enough in regards of performance-optimization. So here is another tip if you are using the Holder-Pattern. If your holder contains a lot of elements like pictures, button and whatsoever, maybe even asynchronously loaded, you might want to try to make use of ViewTypes.

Unfortunately they are not excessively described in the documentation itself, but there has been a brief explanation in a Google IO Event you can watch on youtube.

Theory

What are ViewTypes? To understand this we need to understand how ListView and its recycler works. image

They were originally introduced to control recycler-behavior so the recycler provides in

method a convertView, which is an old, recycled view of a specific viewtype.

Read More

    • #android
    • #holderpattern
    • #listview
    • #versioning
  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Never nerd off
Always nerd on
generated robot wisdom
    • #robot wisdom
    • #random
  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Element disapears in RelativeLayout

You might face the situation where your elements “disapear”, meaning get pushed off the layout. Like it did with the Button here:

image

Read More

    • #Android
    • #RelativeLayout
    • #AlignBottm
    • #LayoutAbove
    • #LayoutBelow
  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Howto: Implement two ListViews scrolling in opposite direction linked to eachother

Title said it all ;) Nevertheless here some explanation:

At some point you might want to implement something interesting no one did before:

Two Lists linked to eachother scrolling in opposite directions. (Sorry to disappoint you, maybe you will come up with something more genuine next time!)

image
(crappy picture I know)

So if for some reason your customer came up with this requirement, here is a solution you might use for your own project:

Read More

    • #Android
    • #ListView
    • #Scrolling
    • #Opposite
    • #Endless
  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Android Scrolling Bug in ICS API lvl 14

PROBLEM:

When implementing a programmatic solution for scrolling in your Android App using an OnScrollListener, you might have experienced problems with following snippet roaming around in the internet:

Rect r = new Rect();
view.getChildVisibleRect(view.getChildAt(0), r, null);
target.setSelectionFromTop(targetPosition, r.top);

r always containing “0,0,0,0”, method returning “false” indicating that ChildView is not visible at all and misbehaving generally, it might be because of a bug which has been introduced in api lvl 14 ICS 4.0.3 which is obviously not fixed yet.

This Error is supposed to be fixed, but seems to be not merged into a main release:

Fix Comment by Gilles Debunne:

Handle animations in Views’ rectangle clipping methods.
getChildVisibleRect and getLocationInWindow do not take the new
mTransformationInfo View attribute.
As a result, these methods return invalid value during an animation
Bug 5638710

Gilles Debunne <debunne@google.com>

SOLUTION:

Instead of calculating the distance to the upper edge to the beginning of the list with method described above, we use:

target.setSelectionFromTop(targetPosition, view.getChildAt(0).getTop());

which works on all versions also in animated situations.

If you have any questions, remarks or curses you want to get rid of, feel free to contact me or reply to this post.

Source :
http://code.metager.de/source/history/android/4.0.3/frameworks-base/core/

    • #Android
    • #getChildVisibleRect
    • #Ice Cream Sandwich
    • #Scrolling
  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 1 of 2
← Newer • Older →

About

Android developer seeking zen.
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union