Questions Thread - June 12, 2016

Questions Thread - June 12, 2016


Questions Thread - June 12, 2016

Posted: 12 Jun 2016 05:06 AM PDT

This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, or Stack Overflow before posting). Examples of questions:

  • How do I pass data between my Activities?
  • Does anyone have a link to the source for the AOSP messaging app?
  • Is it possible to programmatically change the color of the status bar without targeting API 21?

Important: Downvotes are strongly discouraged in this thread. Sorting by new is strongly encouraged.

Large code snippets don't read well on reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

Looking for all the Questions threads? Want an easy way to locate today's thread? Click this link!

submitted by /u/AutoModerator
[link] [comments]

Inject everything - ViewHolder and Dagger 2 (with Multibinding and AutoFactory example) – froger_mcs

Posted: 12 Jun 2016 11:30 PM PDT

Alternative for sticky notification if a background app updated some data

Posted: 12 Jun 2016 03:14 PM PDT

I have an app that most of the time is setup once and than it is running in the background regularly.

Whenever my app changes something (namely profile pictures) it shows a sticky notification. Clicking it opens the app and shows you which contact pictures have been changed and as a side effect an ad is shown.

The pro version allows to remove the notification without opening the app and of course it removes all ads.

Now someone complaint about this behaviour as it is not allowed by Googles rules.

Does anyone know a better alternative for my ad handling? I don't see any alternative way (I want to show ads regularly in the free version). So if I don't want my app to be removed from the play store I only see one solution: removing this sticky notification and make a limited free version.

Any thoughts on this? What would you guys do?

submitted by /u/prom85
[link] [comments]

Clean Java immutability - Alexandru Simonescu

Posted: 12 Jun 2016 11:29 PM PDT

Tab layouts within the navigation bar

Posted: 12 Jun 2016 07:13 PM PDT

How do you guys implement tab layout within navigation drawer? Is it good idea to implement fragment for tab layout and inside that 3 more fragment for 3 tabs? If not, what is the alternative? And yeah, the layout must use coordinator layout, app bar, toolbar etc and tab layout must be inside the app bar.

I tried using frame layout container(outside appbar) where the fragments will inflate. Since other layout must be kept outside of appbar but tabs must be inside the appbar, i am not able to solve. All the tutorials are old and do not use new layouts. So, where and how do i define the frame container layout? Is there any alternative than using libraries? Here is the stack overflow link. http://stackoverflow.com/questions/37780667/navigation-bar-with-tab-layouts

submitted by /u/thestrox
[link] [comments]

How to change icons for Android Studio to differentiate between canary / beta / alpha and production builds.

Posted: 12 Jun 2016 12:51 PM PDT

Instructions [MAC]:

1) Download one of the wonderful icons /u/octarino has created. I'll list them here for convenience. Please upvote his comment here as well.

canary: http://i.imgur.com/GAcvIsP.png

canary-alt: http://i.imgur.com/nMSqg6t.png

beta: http://i.imgur.com/DmjYVCu.png

silly: http://i.imgur.com/jsTDAp7.png

Again, credit to /u/octarino for those icons.

2) [not sure if necessary, but it's what I did and it worked] Once you have one of those downloaded, go to this png --> icns converter and get an icns file for the icon you downloaded in step (1).

3) [again, not sure if necessary, it's what I did] Go to your Applications folder (or wherever your Android Studio preview / canary / whatever lives), hold the control key, and right click the version of Android Studio whose icon you want to change.

4) Click Show Package Contents

5) In Contents/Resources/ you'll find AndroidStudio.icns. Delete that and rename the .icns file you downloaded in step (2) to AndroidStudio.icns

6) I thought that's all I had to do, but mind didn't change immediately (as it was on the Desktop.) The final step I did to change the icon was to copy the new icon, right click on Android Studio --> Get Info --> click the icon at the very top left of the info box (yes, it is selectable; no, I didn't know that either until now) and past the new PNG.

Now you should have a pretty Android Studio icon to help designate between canary build and production build.

Finally, credit to /u/octarino for the icons. Let me know if there are any steps that can be changed or omitted.

Inspired by this post. Hopefully Android Studio will ship with different icons in the future. One can dream.

submitted by /u/halfjew22
[link] [comments]

Getting more into NativeScript I've come to one realization: iOS development you just kind of run some commands and build your app. Android dev, you spend hours getting packages and libraries working properly together before anything happens.

Posted: 12 Jun 2016 10:04 PM PDT

I'm an Android guy at heart though I got back and forth and have devices with both OSes. One thing iOS really has going for it is that getting up and running with dev is super smooth and easy. At least from a beginners point of view (long time web dev, new to app dev).

submitted by /u/DrLeoMarvin
[link] [comments]

tabview animation

Posted: 12 Jun 2016 07:30 PM PDT

Facebook screenshot tests for android

Posted: 12 Jun 2016 01:03 AM PDT

Can Facebook invites be tested before the app is released?

Posted: 12 Jun 2016 12:35 AM PDT

I did a test facebook invite and it says it was sent, but the user received no notification about it on facebook. Can invites be tested before the app is actually released?

submitted by /u/hey619
[link] [comments]
Thanks for reading my news about Questions Thread - June 12, 2016 at my blog Custom Droid Rom if you want too share this article, please put the resource, and if you think this article is very usefully dont forget to bookmark this site with CTRL + D on your keyboard to web browser.

New and Hot Article's :

Note: only a member of this blog may post a comment.