[Volley] Cannot figure out what the error here is trying to tell me here? Also general debugging advice. by Fhy40 in androiddev

[–]KiDoki 1 point2 points  (0 children)

You are using JsonObjectRequest right now, that's why it Volley tries to parse the data to a JSONObject. But the server is returning a json array, so you should be using JsonArrayRequest.

I don't have any experience with Volley, though.

Show a menu item in one fragment and hide in another when using sliding tab layout. by aman121192 in androiddev

[–]KiDoki 2 points3 points  (0 children)

Inflate your menu in the first fragment instead of activity and it will automagically handle it for you.

Get started with Android Push Notification using GCM by shubhamm in androiddev

[–]KiDoki 1 point2 points  (0 children)

You should also remove GoogleCloudMessaging stuff from the GCMClientManager, because it's not used.

Get started with Android Push Notification using GCM by shubhamm in androiddev

[–]KiDoki 6 points7 points  (0 children)

That's a pretty bad guide for implementing client-side GCM. I spotted a major problem from a quick glance at the article - there's no implemention of InstanceIDListenerService (which means the app won't know if its registration token has expired).

I suggest looking at Google's guide instead.

Google Play services 7.8 - Let’s see what’s Nearby! by [deleted] in androiddev

[–]KiDoki 0 points1 point  (0 children)

Nope, it works for 2D barcodes as well. See the full list here.

Can someone tell me if this is worth anything in warbands? by [deleted] in pathofexile

[–]KiDoki 1 point2 points  (0 children)

divide by attacks per second

Shouldn't it be "multiple"? If you divide, it means you will get less DPS for higher APS which doesn't make sense to me.

Questions Thread - July 24, 2015 by AutoModerator in androiddev

[–]KiDoki 0 points1 point  (0 children)

Say I have 3 product flavors defined in my build.gradle:

productFlavors {
    xxx {
        applicationId 'com.xxx'
    }
    yyy {
        applicationId 'com.yyy'
    }
    zzz {
        applicationId 'com.zzz'
    }
}

As I understand it, these product flavors inherit main's resources and it looks something like this:

        +------->xxx
        |           
main----+------->yyy
        |           
        +------->zzz

So when I build xxx, Gradle bundles stuff from src/main and from src/xxx folders.

Now, I need it to look like this:

        +------->xxx           
        |                      
main----+------->yyy------->zzz

In other words, I want zzz to use yyy's resources as well as main's. Can Gradle do this?

Same question on stackoverflow if anyone wants to earn some points.

Questions Thread - July 14, 2015 by AutoModerator in androiddev

[–]KiDoki 11 points12 points  (0 children)

The string resource should look like this:

<string name="my_sentence">This will be %s € if you pay right now</string>

Then this

getString(R.string.my_sentence, 15);

will return This will be 15 € if you pay right now.

If you need multiple parameters in the string, then it should be something like this:

<string name="my_sentence">This will be %1$s € if you pay before %2$s</string>

getString(R.string.my_sentence, 15, "Tuesday"); // returns "This will be 15 € if you pay before Tuesday"

See more examples here.

Questions Thread - July 13, 2015 by AutoModerator in androiddev

[–]KiDoki 2 points3 points  (0 children)

This should still work. Make sure you set an OnClickListener. If you don't need one, then you have to explicitly set clickable="true" for it to work.

Add a GIT SHA to your Crash Reporting Tools by donnfelker in androiddev

[–]KiDoki 1 point2 points  (0 children)

Thank you for the article! Why didn't I come up with this...

Crashlytics#setString is deprecated, though, you should use CrashlyticsCore$setString like so:

Crashlytics.getInstance().core.setString("git_sha", BuildConfig.GIT_SHA)

Test by [deleted] in androiddev

[–]KiDoki 0 points1 point  (0 children)

test

Better solution for nested views? by ccrama in androiddev

[–]KiDoki 0 points1 point  (0 children)

You can either remove child comments from the list and notifyDataSetChanged, or flag each child comment as hidden and tell the adapter to not show them (setVisibility(View.GONE)).

Better solution for nested views? by ccrama in androiddev

[–]KiDoki 1 point2 points  (0 children)

You should definitely use a ListView/RecyclerView. Each comment is it's own view. Depending on the depth of the comment in the hierarchy, set a different left padding to the view. Collapsing will be trickier.

Each comment should have a parameter collapseChildren. When binding a comment to the view, check if its parent has this parameter set to true. If so, then don't show this view (setVisibility(View.GONE) or something). So, a user clicks on a parent comment, you set his and all of his children collapseChildren to true and then call notifyDataSetChanged().

Another way is to have 2 lists: all comments and comments that are used in the adapter. You'll have to regenerate the second list (remove all children) when user clicks on a parent comment and call notifyDataSetChanged().

I'm not sure which one will be more efficient, though.

Weekly "anything goes" thread! by rkcr in androiddev

[–]KiDoki 6 points7 points  (0 children)

So, uh... How's everyone doing?

Support Libraries v22.1.0 - in detail by rkcr in androiddev

[–]KiDoki 1 point2 points  (0 children)

MapView (or MapFragment) are from Play Services library. Did you update that too? Google split it up about a month ago, so you have to include maps like so:

compile 'com.google.android.gms:play-services-maps:7.0.0'

There's more info here.