Questions Thread - June 14, 2016

Questions Thread - June 14, 2016


Questions Thread - June 14, 2016

Posted: 14 Jun 2016 05:07 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]

Gradle 2.14 released

Posted: 14 Jun 2016 08:12 AM PDT

https://docs.gradle.org/current/release-notes

Some nice things:

Faster Gradle builds

Gradle 2.14 brings significant improvements in configuration time. The Gradle build itself has seen a 50% reduction in its startup time. You should see similar improvements for complex builds or those with lots of subprojects. But even small projects will see a noticeable improvement.

More robust and memory-efficient Daemon

The Gradle daemon now actively monitors garbage collection to identify when it's running out of resources. When this happens, Gradle will restart the daemon as soon as the current build finishes.

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

What to do when users report issues with a specific device?

Posted: 14 Jun 2016 03:43 PM PDT

So I released an app around the end of January on the Play Store. About mid way through March, I started getting a larger amount of downloads and it has been pretty steady since. I've just gotten my 1,000th download about 3 weeks ago.

Anyway, I've gotten two reviews on my app. Both of them are complaining that the app does not work on their Samsung Galaxy S7. First guy just gives a flat out 1 star review that says "Does not work". I responded to him saying it would be very helpful if he can be a bit more specific, to which he doesn't respond.

The other one I got about two days ago, this time a 3 star review. The person says they like the idea of the app, but it doesn't work for them. The person basically says "nothing responds".

But what's weird is that I have many people using my app with a Samsung Galaxy S7, which I can see with the device stats that are provided by Google. I'm not sure what could be causing this, and I'm not sure if it is just a coincidence that both are Samsung Galaxy S7 devices.

I thought I'd ask this subreddit for any advice in situations like these. What is the best way to handle something like this?

Edit: By the way, neither user submitted a crash report, so I have no information on what happened.

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

Do you guys use internal getters and setters?

Posted: 14 Jun 2016 09:40 PM PDT

I was just browsing this:

https://developer.android.com/training/articles/perf-tips.html

Noticed this:

In native languages like C++ it's common practice to use getters (i = getCount()) instead of accessing the field directly (i = mCount). This is an excellent habit for C++ and is often practiced in other object oriented languages like C# and Java, because the compiler can usually inline the access, and if you need to restrict or debug field access you can add the code at any time.

However, this is a bad idea on Android. Virtual method calls are expensive, much more so than instance field lookups. It's reasonable to follow common object-oriented programming practices and have getters and setters in the public interface, but within a class you should always access fields directly.

Without a JIT, direct field access is about 3x faster than invoking a trivial getter. With the JIT (where direct field access is as cheap as accessing a local), direct field access is about 7x faster than invoking a trivial getter.

Note that if you're using ProGuard, you can have the best of both worlds because ProGuard can inline accessors for you.

Just curious.

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

Howdo I make a wrapper

Posted: 14 Jun 2016 11:51 PM PDT

Ive been using Swipe for Facebook and Id really like to take a shot at developing a wrapper. Not only that but changing the way the website looks when inside of the app. Ive never made an app and was hoping somebody could point me towards a tutorial or explain the process of making a wrapper to me.

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

Suggestions of "To Do" app tutorials?

Posted: 14 Jun 2016 05:33 PM PDT

I read that making a To Do app is a good way to learn the basics of Android programming. Can anyone recommend a good tutorial? I did find a few but can't tell what would be best for a beginner.

I know nothing of programming outside AHK and a little of actionscript. I've been playing with Android studio the past few days and even created an app or two (just a button that changes text). I'm still at that stage where following steps gets little things done but I can't make much sense of what's happening.

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

Understanding copyright claims when submitting an app

Posted: 14 Jun 2016 11:22 PM PDT

Anyone know what the deal is with the copyright rules when publishing apps. My app has pictures of video game logos. They have rejected it because "your app contains official images of games in the app activity". This is true but so do 100s if other indie apps on the app store. It was my understanding that thumbnails were fair use and these kind of images weren't a big deal anyway. If there is no exception to the rule and this is straight up copyright, how are so many other apps able to do it? Other app developer have hardly gotten the permission from 1000 of publishers to use the images. It makes no sense that I'm getting subject to validation rules that others clearly don't. Is there a trick around this that I don't know?

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

free http/network analytics service (similar to newrelic)

Posted: 14 Jun 2016 10:53 AM PDT

Looking for a design partner for an app

Posted: 14 Jun 2016 05:13 PM PDT

Hello -

I am making an app/game revolving around stock market trading. It is just a small game to work on in my spare time. I am an Android developer by trade, so I am not a student just starting out. I just like to make apps in my spare time.

I am fine with doing all the coding of the app, but it would be great to have someone else on this project who has a better eye for design than I. I can send an in-progress APK right now that has my ideas more or less flushed out, but it just looks like a programmer designed it (if you catch my drift).

I am not looking to hire someone for pay, I am just looking for someone who is interested in working in this project so it can be something they have in their portfolio.

Here is a previous app I have made

https://play.google.com/store/apps/details?id=joe.xkcd

It is something I did right after college, so there are a lot of things I would have done differently, but what can ya do!

If this is the wrong subreddit, or anyone can suggest a more appropriate one to post this to, please let me know!

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

Googles Ad Services Structure explained

Posted: 14 Jun 2016 02:32 PM PDT

Is there a simple explanation of the relations between AdMob, AdWords, AdSense and so on?

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

Pro-tip: Make a habit of using search through keyboard shortcuts (Like Shift+Shift)

Posted: 14 Jun 2016 06:10 AM PDT

Until like a week ago I used to painstakingly sift through dozens of packages and res folders to get to where I want. Simply using SHIFT+SHIFT has had a noticeable impact.

Here's a bunch I'm trying to use as well:

  • CTRL+E: Recent Files
  • CTRL+SHIFT+T: Classes
  • CTRL+SHIFT+R: Files

If you use any other handy shortcuts (specifically for navigating through code), feel free to share them here.

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

Where can I find an UPDATED tutorial/guide on In-App Purchases?

Posted: 14 Jun 2016 11:47 AM PDT

There is no current guide that is A) Updated and/or B) Functioning. I've been told that this recommended library is broken and either way it does not provide sufficient information for a beginner to use it. The official Google docs do not line up with the TrivialDrive sample and neither even work when applied.

Could someone help me out here, I asked this question a million times but no one answers. Where can I learn In-App Purchases properly, all I want to do is set a boolean to true once the user has purchased something.

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

Can't sell my app because of my country (ಠ_ಠ)

Posted: 14 Jun 2016 11:26 AM PDT

I'm an independent android developer, I spent 2 months developing Swipedge App, then when I wanted to monetize my app by locking few features and ask users to pay to unlock those features ... I got this message : "Your country is not supported." ! this is completely unfair, I have users that love my app and would like to pay for it, I have a credit card where I will collect the money but why I can't do this ? because of an unsupported country .. if I were in USA or UK or even India I would put the paid app without any problem !

Please I need your suggestions to solve my problem, Please I need help.

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

[Video] Enabling Offline Capabilities with Retrofit 2 and OkHttp

Posted: 14 Jun 2016 05:40 AM PDT

Electra for android is simple persistence framework with compile time processing.

Posted: 14 Jun 2016 01:30 PM PDT

MVP for Android: the whole deal — Part 1: The theory

Posted: 14 Jun 2016 12:52 AM PDT

Dagger 2 - Yet another question about test modules

Posted: 14 Jun 2016 06:11 AM PDT

I'm struggling with "overriding" module dependencies in tests (unit tests with Mockito, Robolectric, Espresso).

Here's my full injection config -> https://gist.github.com/rafakob/015da9ebed247c4305d07741c4a97f01

I'm using standard MVP patter where presenters are injected into activities. Presenters are added to the dependency graph with constructor injection.

Now let's say I want to override only UserRepo with UserRepoMock class. How should I setup test component for that? I've read a lot different blog posts, but I still can't fully understand this and choose the best solution.

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

Let user choose to violate google rules

Posted: 14 Jun 2016 12:52 AM PDT

I have this question as a result of another question I had:

I want to change my app so that it does not violate any Google rules anymore, namely, I don't use sticky notifications in my free app anymore for a reason not accepted by Google.

I think that most people will prefer the sticky notification solution I had (NEVER had any complaints about it). So I want to keep this behavior as an option and let the user enable it, but only on purpose.

I can't find anything about such a behaviour. Do I break the rules if I don't force a user to accept a google rules violating behaviour but let them MANUALLY accept this behaviour for a better free user experience?

In my opinion this should be ok. Google wants to save their users which is OK. So not forcing the user to have something but letting them to ACTIVELY accept this behaviour (the don't have to, they can always select between Google confirm way and the alternative way) seems user friendly for me, so no need for Google to intervent...

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

The latest Ubertesters SDK for Android is out.

Posted: 14 Jun 2016 06:51 AM PDT

Which Update Checker library do you use?

Posted: 14 Jun 2016 06:25 AM PDT

I use this one, but I just found out that it's code is absolutely atrocious and it leaks the activity instance every single time. So, I'm looking for an alternative.

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

How can I maintain a common module among different projects?

Posted: 14 Jun 2016 02:02 AM PDT

Right now I have to keep going back and forth to trade classes and method in between my apps. I'd like to be a bit more organized.

Ideally, it would be like an offline gradle dependency just available for me. Also, I need to be able to edit it from any workspace (project) opened in AS.

(I don't want any of those utilities libraries floating around github with hundreds of classes and thousands of methods. In the time it takes me to look through those and use them and realize it doesn't do exactly what I want, I could just implement what I want myself)

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

googlesamples/android-OurStreets

Posted: 14 Jun 2016 01:40 AM PDT

Competition for GNSS-based app ideas (deadline June 30)

Posted: 14 Jun 2016 06:16 AM PDT

Thanks for reading my news about Questions Thread - June 14, 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.