Questions Thread - May 26, 2016

Questions Thread - May 26, 2016


Questions Thread - May 26, 2016

Posted: 26 May 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]

Google wins trial against Oracle as jury finds Android is 'fair use'

Posted: 26 May 2016 01:27 PM PDT

Significant build time issues with Android Studio on one particular computer. Gradle command line builds in 2 minutes, Android Studio takes 6 minutes for the same thing?

Posted: 26 May 2016 04:45 PM PDT

I'm having a huge issue with Android Studio build times only on one specific computer, and it's not related to Gradle settings or build configuration. In fact, I've learned extensively about all the Gradle settings and usual project optimisations over the past week, and implemented them to no avail.

On one MBP we have here in my office, doing a full clean & build with the Run button completes in just over two minutes, but on my MBP (same specs) the same task takes 6 minutes. All gradle settings (RAM etc) and Java versions are identical.

When I build my project inside Android Studio itself (using the Run button), Android Studio's Gradle Console gives me the following:

Executing tasks: [:app:clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources, :app:assembleDebug] .... Gradle build finished in 6m 7s 299ms 

Now this should translate to the following Gradle command:

./gradlew clean generateDebugSources prepareDebugUnitTestDependencies mockableAndroidJar generateDebugAndroidTestSources assembleDebug 

When I run that on the command line on my MBP, my total build time is just under 2 minutes. When I add "installDebug" and an "&& adb start" command, which is what I would guess Android Studio normally does in the background, it extends that time out to about 2 minutes and 10 seconds - and this is roughly the same amount of time that the other equally spec'd MBP is taking to build and deploy the app.

So I can actually build, push and run this project in around 2 minutes, but ONLY if I do it from the command line, which I've now written a script to do. But it's ridiculous that I have to resort to this, and it's just a hassle. Where could the extra 4 minutes possibly be coming from? What could Android Studio be doing in those 4 minutes? This is baffling to me and the other devs here in my office. It also makes no difference whether it's deploying to a real device or an AVD.

Does anyone have any thoughts or suggestions?

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

Conductor + Mosby Examples

Posted: 26 May 2016 09:49 PM PDT

Does anyone have any Conductor + Mosby example apps? I'm just starting to build my app (not new to Android) but wanted to use MVP this time around.

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

Staying motivated

Posted: 26 May 2016 05:53 PM PDT

I'm a rookie when it comes to being a developer. I am going to school for it though. I've been doing a lot of self-learning lately. To try and get up to speed. But alas, I have run into a wall.

I'm building a app for myself. It was supposed to be simple. A simple budget app. Now, I feel like I may have jumped in too deep for a first app. I'm sure for some it is a simple app they can make in a few hours, at most. Is this common? How did you stay motivated at the beginning?

It's not a simple app to the point of just having blank fields to fill in. I wanted them dynamic. And a few other things, but it seems like it is a struggle to make an ounce of progress on the app.

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

Exploring the new Android ConstraintLayout

Posted: 26 May 2016 12:42 PM PDT

Android Testing Support - Android Testing Patterns #1

Posted: 26 May 2016 12:45 PM PDT

Using firebase and/or local sql database syncing depending on if user is "premium" and has a network available.

Posted: 26 May 2016 09:16 PM PDT

About to try building an app where there will be multiple devices on a local network all adding/changing a shared local database. The database needs to be very fresh and instantly update the other local devices. The user can upgrade and use cloud storage as well to backup this db and view it remotely, but must still function in "offline" mode(no network temporarily).

Syncing local databases: 1. Each device has to have a local sql database, correct? 2. What backend can I use to live update the other local network devices of changes?

Cloud syncing databases: 1. Firebase seems to be what I need here, correct? 2. Should I rely on firebase only when it's available? What I mean is, when the user has "upgraded" AND an internet connection is available should I just skip whatever local db syncing method I use and solely rely on firebase?

Thanks.

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

About Crashlytics...

Posted: 26 May 2016 08:59 PM PDT

I'm using Flurry right now in my application to track new users, patterns etc.

Among the features I love is the crash reports that are extremely helpful.

I see crashlytics being praised all the time here, would I be benefited from adding it to my app? Would it show me more info about the crashes?

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

DebugRank: Applying MVP in Android

Posted: 26 May 2016 08:22 AM PDT

How can I monetize an free android app which has no layout?

Posted: 26 May 2016 04:34 AM PDT

Title says it all. App has 190k + active installs.

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

Decoupled activity presentation

Posted: 26 May 2016 11:42 AM PDT

Hi all, I'm new to Android but senior iOS. Hope this isn't a stupid question.

I'm building an app with RxJava and I have a bunch of logic that determines which activity to display. Basically I have a class that routes the app to the appropriate activity and (in iOS at least) builds any missing parts of the stack beneath it.

What is the best way to initiate a transition from one activity to another, without coupling all the activities together? I've been told using application context to start an activity is a bad idea (although I'm unclear why), so should I hold a reference to the current activity and start the new one from my routing class?

Thanks!

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

Making money with Ads

Posted: 26 May 2016 12:04 PM PDT

This may have been covered ( i tried searching )... But, how many active users does an app need to have in order to make a decent amount of money / month using ads.

Lets say if one wants to make about $3000-$5000 or more..

Thanks

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

How a few developers already won I/O 2017 tickets

Posted: 26 May 2016 05:59 PM PDT

Why is the support design library dependent upon old appcompat libraries?

Posted: 26 May 2016 01:40 PM PDT

New android dev here (well... trying to be anyway). Doing some proof of concept work, evaluating native vs hybrid (ew!) and fell a bit down the rabbit hole.

My company is interested in creating an app, but doesn't want to bother with targeting older versions of software (e.g. we don't support <IE10). I'm trying to look at achieving the same thing with the android app, but I'm a bit confused.

Say for example, we don't want to support anything less than v21 of the SDK. Therefore, I wouldn't need to use the AppCompat libraries... or so I thought. Why is it then that the newer Android Design Support Library has dependencies upon the old AppCompat libraries? If material design is native to v21 and higher, why are there controls that only exist with relation to the AppCompat libraries?

For example, the TextEditInputText class depends on v7. Shouldn't there be an analog that exists without depending on v7?

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

How to realize "no Android framework on the business layer" ?

Posted: 26 May 2016 01:07 AM PDT

I have read many times the "no android framework on the business layer" rule. I wonder how to realize that simply. The clean architecture has that idea but it implies to have the db on the outest layer and to have it convert its data to/from the business layer (innest layer). This leads to a non conventional way of developing (complexity) where the storage (db, shared preferences) is on a superior layer than the business layer.

Is there an easier way to respect this rule ? There is common services used for the business logic that remain on the Android framework : shared preferences, database, etc. which can be implied within the business logic. How to deal with simply ?

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

Hooking into Google maps app?

Posted: 26 May 2016 05:15 PM PDT

Can I create an android application that logs data when the Google maps application is used? I basically want the app to run in tandem with Google maps.

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

Need your thought on this issue

Posted: 26 May 2016 11:15 AM PDT

I have an interview tomorrow, its for android developer position and they are going to ask me to do some changes and refactor the code which I have written as an assignment earlier, Thing is while writing android code I often look up online for documentation and syntax as I suppose every developer does, but here I wont be allowed to use internet, any suggestions how should I prepare for such situation ?

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

Quick overview to Android Security Providers

Posted: 26 May 2016 01:24 PM PDT

Ways to do cloud sync?

Posted: 26 May 2016 03:14 AM PDT

Disclaimer: I'm not a developer, I'm asking on behalf of this project.

Is there any free way to do cloud sync? Like for bookmarking and other stuff? I asked the developer but he said there's no way to do it without a server. Anyone wondering what I'm asking for actually, look at mangawatcher app's (it's on bitbucket) cloud sync.

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

Learning curve from SurfaceView game to libgdx

Posted: 26 May 2016 02:17 PM PDT

I recently released my first Android app/game to the market this week. I coded it using SurfaceView and Canvas to get a better feel for the Android native environment. As you already know, there are problems in continuing to do it this method - mostly in maintainability and developing an engine from scratch. I might get by by doing this for a few games, but I know that libgdx is a much better way of making a game to save loads time.

Question is: How hard is it to learn libgdx? How would you recommend learning it?

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

Tutorial: Using Java 8 Features When Developing for Android N

Posted: 25 May 2016 11:09 PM PDT

CompletableFuture for Android

Posted: 26 May 2016 04:21 AM PDT

Guys,

Have you seen implementation of java8-like futures for Android?

Of course, I know about rxAndroid and even used it in one of the projects but in my mind it doesn't fit my requirements. I think it's kinda overengineering for most Android apps untill you process/create streams of data. Here is my main concern about rxAndroid: most async ops emit only 1 event not lists. On another hand CompletableFuture does exactly what I expect - the simple way to create, transform and manage single IO operations

submitted by /u/therux
[link] [comments]
Thanks for reading my news about Questions Thread - May 26, 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.