Questions Thread - August 31, 2016

Questions Thread - August 31, 2016


Questions Thread - August 31, 2016

Posted: 31 Aug 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!

Also, please don't link to Play Store pages or ask for feedback on this thread. Save those for the App Feedback threads we host on Saturdays.

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

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

What 2 Years of Android Development Have Taught Me the Hard Way

Posted: 31 Aug 2016 01:27 PM PDT

Why is Android careless about NDK even AFTER YEARS?

Posted: 31 Aug 2016 09:45 AM PDT

Hi, I am wondering why Android's NDK (current ndk-12) has just a fraction of the features compared to its Java pendant?

There is no way around C/C++ for real-time virtual reality applications. However, due to the limitations of NDK it is de-facto impossible to make such apps.

Example: For now, you cannot have native camera access. This forces you to switch to Java. You will drop some FPS by doing so. In Java the best-case frame rate is 30 FPS (just fetching frames, no actual image processing). In my view this is ridiculous.

With an IPhone you can grind left handedly 60 FPS and go all C/C++.

Here is a thread someone pointing it out BACK IN 2009! https://groups.google.com/forum/#!searchin/android-ndk/camera%7Csort:relevance/android-ndk/qehnrEEoxa0/FAnRodBr0FYJ

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

Custom Views and ViewGroups: Measure, Layout, Draw, Repeat

Posted: 31 Aug 2016 11:47 AM PDT

RecyclerView snapping with SnapHelper

Posted: 31 Aug 2016 12:52 AM PDT

Mosby with Realm

Posted: 31 Aug 2016 06:47 PM PDT

Does anyone know of a complete example of best practices using Mosby and Realm?

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

I want to do Android development, but can't come up with any app ideas

Posted: 31 Aug 2016 11:48 AM PDT

Android development is something I've wanted to get into for a long time, as early as the 1.x days. I dabbled around the 2.x era and got close to releasing a game I was working on, then got busy with school and never released it. Now I'm picking it back up, but I feel like so many of the potential good app ideas have been done by now.

Currently, I'm focusing more on making things for the sake of making things. I spent the past weekend writing a crappy Instant Messaging program using Firebase as a backend to learn about Firebase. I spent Monday evening refactoring it to make use of MVP rather than One-Big-Activity. Yesterday I further refactored it to make use of Dagger and ButterKnife. I plan to continue working on this app as a method of learning new libraries and design patterns. Next on the list I think is to adapt parts of it to make use of RxJava.

Once that project is "done" I'll probably keep churning through the classics. Like a To-do list app, everyone seems to need to write one of those :)

Practice is all well and good, but I want to eventually get to the point where I'm planning on creating something to actually release. So, I'm curious, where do you draw your inspiration from?

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

A Kotlin library allowing writing asynchronous code in synchronous style

Posted: 31 Aug 2016 03:53 AM PDT

Thanks for coroutines introduced in Kotlin 1.1, we built a tiny Async/Await library allowing writing asynchronous code by very straightforward manner, like

async { progressBar.visibility = View.VISIBLE // Release main thread and wait until text is loaded in background thread val loadedText = await { loadFromServer() } // Loaded successfully, come back in UI thread and show the result txtResult.text = loadedText progressBar.visibility = View.INVISIBLE } 

You may have many await calls inside async block, have it in loop etc.

Disclaimer: Kotlin 1.1 is not released yet, you have to use latest EAP in order to use the library. See detailed instructions on the library's homepage.

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

What is the best approach for custom loading & success animations?

Posted: 31 Aug 2016 06:17 AM PDT

I've been looking into animations for Android there I am unsure about the best way to create them. What I'd like: a spinning circle (with some pieces missing) that becomes an entire circle then a checkmark forms inside of it. What is the best way to handle it?

Approaches I've noticed

  • Frame By Frame Animation
  • View Animation
  • Property Animation
  • Canvas

Any help or resources would be appreciated.

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

Fuse v0.25 is now released!

Posted: 31 Aug 2016 08:56 PM PDT

Granting Permissions on a Uri in an Intent Extra - The CommonsBlog

Posted: 31 Aug 2016 06:31 AM PDT

API for chance of rain?

Posted: 31 Aug 2016 03:29 PM PDT

I've looked at Open Weather and it doesn't look like it has chance of rain percentage for the next day. Anyone know of any (preferably free) other ones?

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

How to Build an App Like Romans Built a City: Part II

Posted: 31 Aug 2016 11:38 AM PDT

Microphone PCM to Playable AAC for RTMP Stream

Posted: 31 Aug 2016 11:24 AM PDT

Hey guys, I'm having some problems with encoding. How can i encode pcm to aac for rtmp stream. Any ideaa ?

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

Error Code -2 from Google Play Store

Posted: 31 Aug 2016 11:01 AM PDT

I have researched in depth into this issue, and could use a bit of insight. For whatever reason users are trying to download our application from the Google Play Store and receive an error code -2. From everything I have read online, it seems as though a republish would fix the issue. Figured it wouldn't hurt to reach out and see if anyone else has similarly faced this issue, and what steps you took to fix. Thanks

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

Introducing ExpandableRecyclerView - Amanda Hill

Posted: 31 Aug 2016 01:46 AM PDT

The future of mobile payments and emerging opportunities for developers

Posted: 31 Aug 2016 10:19 AM PDT

Learning how to make my first app, having trouble figuring out how to query user posts by location with dynamoDB

Posted: 31 Aug 2016 01:50 PM PDT

To try and learn how to create my first app I'm basically trying to re-create OfferUp an app which is like Craigslist but functions on local posts filtered by location.

I understand how to get a users location from androids location updates, and how to create a table with attributes in DyanmoDb with user posts.

I don't get how to query the posts based off location. I'm assuming I can store the Sellers location in Latitude/Longitude points as an attribute to their post, but I'm not sure how to filter out search results based on location from that.

So basically I understand how to ask for and store a Users location but I don't understand how to query based on that.

Hoping someone could point me in the right direction.

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

TIL: Android design support lib 24.2.0 added an extra FrameLayout between TextInputLayout & EditText

Posted: 31 Aug 2016 07:12 AM PDT

Tendencies on modern Android development

Posted: 31 Aug 2016 03:23 AM PDT

I worked in Android back in late 2012 - early 2013 and then a little more in 2014. Now I am back fully in Android dev (spent the last three years on big web application development with Spring, Hibernate, etc.) and I feel kind of lost.

The API has not changed that much I admit but I've spent some time reading stuff online and I don't know what's the tendency anymore. There is so much information online, and such a big part of that is outdated, it is hard to know how to start an app from scratch with the best, current practices. Back in the day Fragments where the thing and now I've read people absolutely dismissing them for overcomplicating the code.

I've seen libraries like Dagger, Mortar & Flow, using retrofit for REST and Picasso for images (it was UIL back then!), people advocating for Reactive, etc. I also know there is no single bullet but I need to know about the stuff before I can decide it is useful for me or not.

Any good website where I can check all these things and what they are good for? I know I can search every one of these terms but maybe there are some other good things that I'm missing.

submitted by /u/kelmer44
[link] [comments]
Previous
Next Post »