Questions Thread - June 05, 2016

Questions Thread - June 05, 2016


Questions Thread - June 05, 2016

Posted: 05 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]

my fellow Canadian developers, how do you file taxes from your Play Store earnings?

Posted: 05 Jun 2016 04:51 PM PDT

I have an app that I would like to start selling. Before that o want to understand the tax implications. I am in Ontario Canada.

Some of the questions that keep me confused are:

  1. What specific tax form (form number?) does Google provide to you at the end of the year? Looking for the form number so I can research further what is in it.

  2. What about Sales Tax? Does Google charge that to the app user directly during the app purchase or will I have to do anything with it?

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

Potential Impact of Google Play store on Chromebooks / Chrome OS

Posted: 05 Jun 2016 07:23 PM PDT

Material Design Dimens: Default colors and dimens per Material Design guidelines

Posted: 05 Jun 2016 01:20 AM PDT

Will converting my views to Java make them faster?

Posted: 05 Jun 2016 04:40 AM PDT

Wasn't there a library post the other day saying how views from code were significantly faster than XML? 'Anko' something library.

Not all views, just where it matters the most. Like in a grid or recyclerview, where you have to instantiate dozens of them, if not hundreds or thousands.

I'm going to benchmark it right now, but is this like a common thing? (thing= instead of using xml layouts, instantiating views in java and setting the attributes programmatically)

*Found this benchmark, seems like Java is ~40% faster than XML.

**Reason I started digging around was my gridView that had tons of bitmaps was slow as hell. I profiled the shit out of everything. XML View inflation averaged around 0.5ms (with recycling), and Java around 0.45ms. I.e, it was not even worth the time I spent doing it. And my bitmap creation process was taking up to 30ms. By simply reusing the Paint object I got it down to ~25ms, orders of magnitude more speed up than view inflation (XML or java) could have ever given me. Then I figured out a way to minimize bitmap allocations, fixed some overdraw, used an object pool and a LRU cache for some data that the bitmaps needed to be created, offloaded some work to elsewhere etc. I'm now under the 16ms line.

TL;DR: Know what to fix before fixing it.

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

Android Studio Login and Register tutorial with MYSQL database

Posted: 05 Jun 2016 11:29 AM PDT

Hello androiddev, I just finished making a new Login and Register tutorial using a MYSQL database. It covers a ton of material (it's a 6 video playlist :P). For you beginners out there, by the end of it you will know how to:

1) Purchase your own domain (It's super cheap - about $4.00/month)

2) How to create tables and users for your MYSQL database (no previous MYSQL knowledge needed!)

3) How to write some basic PHP to connect/access the data stored on your MYSQL database (No previous PHP knowledge needed!)

4) How to build an Android Application that can send and receive data from your MYSQL database.

Tell me what you think.

Youtube link: https://www.youtube.com/watch?v=FMp_bkzlx1g

Blog: http://www.codingwithmitch.com/login-and-register-application-that-uses-a-mysql-database-in-the-cloud/

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

Homing device for Kit

Posted: 05 Jun 2016 08:34 PM PDT

Hi guys, A local team of volunteers here in New Zealand, is looking an Android Wear watch to develop a navigation application for a blind person, Kit. Also, possibly for more general use for the visually impaired. Kit likes swimming in the sea, but has difficulty finding his way up the beach back to the entrance of a track that leads to his house. So we are considering using a watch to help him navigate, initially via GPS and magnetometer (so that he can orient in the right direction), then using a BLE proximity beacon for the last part of the journey (as it needs higher accuracy than GPS to find the start of the track). Ironically Kit, who was a renown sound engineer on many NZ films, uses hearing aids, which he can't take in the water, so is also effectively deaf when he emerges!

We have never programmed a watch before so have some fundamental questions:

Is what we want to do achievable using Android Wear? In other words is it possible to develop significant applications that access watch resources including GPS, vibrator, buttons, BLE, magnetometer?

Is there likely to be sufficient rom/ram to implement a program that does location and compass calculations to guide kit between a series of waypoints? Clearly it depends, but it could be quite a complex programming with floating point calculations.

Will we effectively be able to take over the user interface to use just keys and tactile feedback from a vibrator?

Clearly the screen will be fairly useless to Kit, and his hearing problem means that tones won't help!

Will we be able to programme the Bluetooth (smart) functionality for proximity beacon detection?

Has anything like this been done already? If so, references and contacts would be really helpful.

The watch requires: Waterproof, as Kit will be wearing it whilst swimming. Accurate GPS, for initial navigation between waypoints. Magnetometer, for orientation and course corrections. Vibration patterns, to communicate with Kit Key controls, preferable to touch screen (although very coarse touch screen controls might also be useful) Gyroscope, ideally, for gesture control Bluetooth (smart), for beacon scanning and proximity detection, for last part of journey (this is critical)

Other comments / views on what we are wanting to achieve would be very much appreciated. Best wishes, Ron.

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

Should I get back into Android dev? How should I do so?

Posted: 05 Jun 2016 11:12 AM PDT

The last time I developed for Android was 2014. I believe Lollipop was just coming out (or the preview). I'm sure so much has changed since then.

I'm now a full-time college student, so time is limited. That said, I have found that app development and programming as extracurriculars have been very rewarding so far (e.g. programming experience, portfolio builder, conversation starters, networking, interviews, etc.).

It's something I want to get back into. For the past 1-2 years I have dabbled in iOS, publishing two apps to the App Store. These netted me ~$500, minus another $198 (x2 $99 yearly iTunes Connect fee), for a total of ~$300 in profit. This is definitely not survivable income.

I have published over 10 Android apps and made a measly ~$120 from those.

However, I have learned and matured much since then. I'm looking at taking another serious stab at app development. Worst case, I could build up my portfolio/resume even more, either leading to a job or starting my own dev shop.

There are certain things I like and dislike about both Android and iOS. Here are my main points about each:

Android:

  • (pro) I had this feeling that overall it was easier to develop Android apps.
  • (pro) I like laying out UIs by XML (not a fan of Xcode UI editing).
  • (pro) Android Studio works on both my Mac and a Windows (should I ever not be able to replace my Mac as a poor college student).
  • (pro) Java language, which can be more versatile should I apply for other programming jobs outside of the Android world.
  • (con) Java language, which may or may not be dying (cough Oracle cough).
  • (pro) Java language, which was my first serious programming language. I haven't used it in awhile, but I'm confident I could become comfortable and proficient in it fairly quickly.
  • (con) From what I've heard, Android APIs are becoming worse and worse (e.g. UI libraries).
  • (con) I only have a half-decent Android phone at my disposal; either I could use an Android emulator (slow) or test my work on an Android 4.0 prepaid phone (not as slow as an emulator, but outdated nonetheless).
  • (con) It's easier for people to pirate your app.
  • (con) Google Play bans are bad. I had an app removed for keyword spam and another app removed for being too close to the name of a popular trademark (this one was unintentional, but I learned my lesson). Once you're banned, you're pretty much done. I'm not sure how many "strikes" you get, but I'm scared of accidentally getting a third one, unintentionally.
  • (pro) Easier to prep your app for the Google Play store than for the Apple App Store.

iOS:

  • (pro?) I made more money on the App Store. However, it's arguable if it actually means anything as my anecdotal experience didn't make enough money nor publish enough apps to get a bigger picture.
  • (pro) I own an iPad Mini and an iPhone, so it's easier to test my work on.
  • (mixed) Swift language, which is very "easy" to work in. I really like the Swift language and it feels very flexible. At the same time, I appreciate the strict standards of the Java language.
  • (pro) Much more protections for your app (harder for users to pirate it).
  • (pro) People more likely to pay to buy/download apps.
  • (pro) I noticed that junior iOS/Swift developer positions often pay more in the United States than junior Android/Java positions, at least when I was interviewing and browsing job openings.
  • (con) Xcode is slow; My MacBook is approaching 4-5 years in age and I notice that Xcode has a horrendous start-up time as well as some lag when switching between files. Whereas Android Studio runs smoother. Additionally, if I need to replace my laptop in the near future, it will likely be a Windows laptop unless I stumble upon a boost in finances. This poses a serious threat/risk to my future iOS development.
  • (pro?) Was thinking of starting a dev shop with a friend or two later down the road. However, they are both Android people. Although there's no guarantee this will work out and that we'll actually commit to it.
  • (pro) Apple is not as ban-happy as Google.
  • (con) App Store preparation is far more strict than Google Play (e.g. image sizes and resolutions and other requirements).

tl;dr Hesitant at choosing a platform while wanting to get back into mobile development. Convince me.

submitted by /u/95shane
[link] [comments]

HorizontalWheelView - interactive alternative to SeekBar

Posted: 05 Jun 2016 01:13 AM PDT

What you don't know about top android app testing challenges may shock you

Posted: 05 Jun 2016 09:53 PM PDT

Implementing Google Material Motion guidline

Posted: 05 Jun 2016 12:32 AM PDT

Hey guys, i tried to implement 2 animations from Google Motion Guidline as samples for new CircularReveal library update. But i had some troubles with implementing little things like sequential square & circle dots appearing due to high speed of animation i didn't recognized what's going on under the hood, can someone see what's changing in this animation? :)

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

How do YOU figure out performance bottlenecks in your app?

Posted: 05 Jun 2016 01:30 AM PDT

Requesting Feedback for Android Developer Tool I am Making

Posted: 05 Jun 2016 07:56 AM PDT

I am building a real-time custom object and crash analytics data logger for Android. I have been frustrated by the current options on the market (such as Loggly) which severely limit me in the type of data I can upload and by absurd costs for high data volume.

The first half of the product is an API, which allows you do easily log json serializable objects filled with useful data, or log call stack data from caught exceptions. Furthermore, there is a flag which can configure the API to automatically send call stack data from uncaught exceptions. It handles all the nasty stuff like batch uploading, caching, etc.

The second half of the product is a middle layer server which ideally will be able to be provisioned in house, or on Azure/AWS. This layer is what directly listens for packets from the device. It exposes a front end which allows the user to configure it to stop receiving data from certain logs, change sampling rates, and configure data forwarding to Elasticsearch, Splunk, Redshift or a custom HTTPS endpoint for further data analysis. The Elasticsearch/Kibana stack is easy to provision, and is very powerful for data analysis.

I have a high amount of motivation to build this for my own usage. However, I believe this can help others in gaining useful insights from their users, as well as useful information to fix their bugs, without being bottlenecked by data volume. I am looking to get information from potential users, thus I am wondering if you would find this product useful, or anything else you would like to share.

Thanks, looking forward to your responses. Feel free to talk to me via pm as well.

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

Android Vector Drawable Example using AppCompat Support Library

Posted: 05 Jun 2016 08:52 AM PDT

Fed Up of creating separate images for different size image for mdpi, hdpi,xhdpi and etc. Now there is no need to design different size image for mdpi, hdpi,xhdpi and etc. With Vector Drawable you need to create image only once as an xml file and you can scale it for all dpi and for different devices. This also not save space but also simplifies maintenance. DOWNLOAD SOURCE CODE or Explore on GITHUB . ‪#‎android‬ ‪#‎android_developer‬ ‪#‎developer_android‬ ‪#‎appcompat‬ ‪#‎android_theme‬ ‪#‎support_library‬ ‪#‎library‬ ‪#‎android_support_library‬ ‪#‎material_design‬ ‪#‎android_tutorial‬ ‪#‎android_code‬ http://www.androidtutorialshub.com/android-vector-drawable-example-using-appcompat-support-library/

submitted by /u/lalit-vasan
[link] [comments]

send Arraylist between two fragments

Posted: 05 Jun 2016 04:20 AM PDT

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