• Breaking News

    [Android][timeline][#f39c12]

    Sunday, June 30, 2019

    🔴 HAL: a non-deterministic finite-state machine for Android & JVM that won't let you down Android Dev

    �� HAL: a non-deterministic finite-state machine for Android & JVM that won't let you down Android Dev


    �� HAL: a non-deterministic finite-state machine for Android & JVM that won't let you down

    Posted: 30 Jun 2019 11:08 AM PDT

    There's no direct way to know first visible item in recyclerview, so I created a dsl for a project. Would anyone be interested in a tiny library for it?

    Posted: 30 Jun 2019 03:01 AM PDT

    Trying Jetpack Compose on Windows 10

    Posted: 30 Jun 2019 07:49 AM PDT

    I wanted to try Jetpack Compose, but i have Windows 10, so after lots of attempts i was able to compile and run it on Windows 10. And i wrote an article how to do it:

    https://medium.com/@Alex.v/running-jetpack-compose-on-windows-10-954738828f0b

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

    Affordable map APIs - non existent?

    Posted: 30 Jun 2019 03:25 PM PDT

    I'm a single developer mid way through developing my location-based app.

    I feel abit naive now as I assumed maps APIs would not be a problem, but after some research I've discovered that using any of the popular APIs (Google Maps, Mapbox) simply isn't sustainable.

    It would cost me atleast $500/M just for directions API on Mapbox, assuming I had 500,000 requests a month for this API. Which is only 16,000 requests per day. So say I have 16,000 daily users, the prices would go up even more if they use it more than once. (I still find this hard to believe, as most businesses already with a revenue model in place would struggle to break even, can someone confirm this is right?)

    I've looked into Open Street Maps which is an open source map API - from what I can tell it is free and can be combined with leaflet if I'm not wrong?

    However there is very few resources on this - if there are any tutorials on how to add this to my Android app I will be happy to spend time building it.

    If anyone have any advice/suggestions that would be greatly appreciated.

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

    Is it possible to unlock a device using an NFC tag?

    Posted: 30 Jun 2019 05:21 AM PDT

    If a device has a password/code/pattern lock screen, could it be set up to unlock using an NFC tag?

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

    Amazon App Store payment when I'm under 18

    Posted: 30 Jun 2019 09:45 AM PDT

    I've written an app which I would like to publish on the Amazon App Store for a few cents. I can't use the Google Play Store because I'm under 18. However, I couldn't find anything which says that I have to be 18 to publish apps and receive payments for them. So am I allowed to do that, or is that forbidden like many similar things for people who are under 18 which should „protect" them, but instead just prevent them?

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

    Good device for development?

    Posted: 30 Jun 2019 03:15 PM PDT

    I'm an iPhone user, but am an android developer at a company.

    I'd like to start developing some side projects, what device would you guys recommend I purchase to develop on? My budget is probably $200 max.

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

    Why combining WorkContinuation doesn't work for unique works?

    Posted: 30 Jun 2019 09:26 AM PDT

    I've encountered behavior of WorkManager (version 2.0.1) that I cannot understand. Unfortunately this behavior leads to issues in my application. To illustrate my problem, I will use a simpler example.

    Let's assume with have three Worker implementations - UniqueWorker1, UniqueWorker2 and FinishingWorker.

    class UniqueWorker1(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) { override fun doWork(): Result { if (runAttemptCount == 0) { Log.d("UniqueWorker1", "First try.") return Result.retry() } Log.d("UniqueWorker1", "Second try") return Result.success() } } class UniqueWorker2(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) { override fun doWork(): Result { Log.d("UniqueWorker2", "doWork") return Result.success() } } class FinishingWorker(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) { override fun doWork(): Result { Log.d("FinishingWorker", "doWork") return Result.success() } } 

    As you can see, the first worker succeeds after second run attempt. Others just log the message and return successful result.

    Now I'm enqueueing these workers in two ways. Firstly I start UniqueWorker1 as the unique work and tell WorkManager to run FinishingWorker when UniqueWorker1 succeeds.

    val uniqueWorker1 = OneTimeWorkRequest.Builder(UniqueWorker1::class.java).build() val finishingWorker = OneTimeWorkRequest.Builder(FinishingWorker::class.java).build() val uniqueWorkContinuation = WorkManager.getInstance() .beginUniqueWork("UniqueWorker", ExistingWorkPolicy.KEEP, uniqueWorker1) val continuations = listOf(uniqueWorkContinuation) WorkContinuation.combine(continuations) .then(finishingWorker) .enqueue() 

    The second way looks like that: I combine unique works of UniqueWork1 and UniqueWork2. Then I tell WorkManager to run FinishingWorker when both works complete.

    val uniqueWorker1 = OneTimeWorkRequest.Builder(UniqueWorker1::class.java).build() val uniqueWorker2 = OneTimeWorkRequest.Builder(UniqueWorker2::class.java).build() val finishingWorker = OneTimeWorkRequest.Builder(FinishingWorker::class.java).build() val uniqueWorkContinuation1 = WorkManager.getInstance() .beginUniqueWork("UniqueWorker1", ExistingWorkPolicy.KEEP, uniqueWorker1) val uniqueWorkContinuation2 = WorkManager.getInstance() .beginUniqueWork("UniqueWorker2", ExistingWorkPolicy.KEEP, uniqueWorker2) val continuations = listOf(uniqueWorkContinuation1, uniqueWorkContinuation2) WorkContinuation.combine(continuations) .then(finishingWorker) .enqueue() 

    Now imagine such case. I start workers in a first way. The UniqueWorker1 retries because it's his first run attempt. We have 30 seconds to wait (with the default BackoffPolicy values). Before it retries, I start workers in a second way. The UniqueWorker1 is not enqueued (because it has been already started) but UniqueWorker2 starts its work. Now after 30 seconds, UniqueWorker1` succeeds, the WorkManager starts FinishingWorker, because of the first way work combination. The problem is that WorkManager doesn't start FinishingWorker for the second time. Why it should start FinishingWorker for the second time? Because work combination in a second way tells to start FinishingWorker when UniqueWorker1 succeeds and UniqueWorker2 succeeds. UniqueWorker2 succeeded immediately and UniqueWorker1 succeeded after 30s.

    At the beginning I thought that when WorkerManager sees that when one of the works in work combination is already enqueued, it won't finish and won't run request from then method. But I checked this in a simpler example and it worked.

    So the output of the situation I described looks like that:

    // Run workers in a first way D/UniqueWorker1: First try. I/WM-WorkerWrapper: Worker result RETRY for Work [ id=7e2fe6b4-4c8e-42af-8a13-244c0cc30059, tags={ UniqueWorker1 } ] // Run workers in a second way before 30s will pass E/WM-EnqueueRunnable: Prerequisite b98a6246-28d4-4b25-ae50-ec3dda6cd3ac doesn't exist; not enqueuing E/WM-EnqueueRunnable: Prerequisite 02d017e7-30b0-4038-9b44-a6217da3979c doesn't exist; not enqueuing D/UniqueWorker2: doWork I/WM-WorkerWrapper: Worker result SUCCESS for Work [ id=ce9810cd-9565-4cad-b7d1-9556a01eae67, tags={ UniqueWorker2 } ] // 30s passed D/UniqueWorker1: Second try I/WM-WorkerWrapper: Worker result SUCCESS for Work [ id=7e2fe6b4-4c8e-42af-8a13-244c0cc30059, tags={ UniqueWorker1 } ] I/WM-WorkerWrapper: Setting status to enqueued for c2ac89de-3a67-496f-93e6-037d85d11646 I/WM-WorkerWrapper: Worker result SUCCESS for Work [ id=c2ac89de-3a67-496f-93e6-037d85d11646, tags={ androidx.work.impl.workers.CombineContinuationsWorker } ] I/WM-WorkerWrapper: Setting status to enqueued for 3287bbec-b1c4-488a-b64b-35e0e6b58137 D/FinishingWorker: doWork I/WM-WorkerWrapper: Worker result SUCCESS for Work [ id=3287bbec-b1c4-488a-b64b-35e0e6b58137, tags={ FinishingWorker } ] 

    As you can see FinishingWorker was enqueued only once. Sorry for the long explanation but this example shows exactly my problem. It's a serious issue for me because some of the important workers are not enqueued.

    Question

    Can someone explain the reason of such behavior? Is it intended behavior of WorkManager or is it a bug?

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

    FCM or OneSignal?

    Posted: 30 Jun 2019 01:07 PM PDT

    Dear Android Dev,

    I'm a little in doubt. I use Firebase for a lot of things, and am really satisfied with anything Firebase related, but I've read some negative opinions on FCM. Should I go with Firebase Cloud Messaging for my Android notifications or should I go with OneSignal?

    Would anyone be able to share some experiences / pro & cons?

    Edit: app is native Android, and back end SDKs seem pretty equally easy, however I'm not entirely sure about that.

    Thanks guys!!

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

    Strange results of Google Play experiment. Why could this happen?

    Posted: 30 Jun 2019 01:04 AM PDT

    Sorting by variables

    Posted: 30 Jun 2019 07:50 AM PDT

    I'm really new to this. If I want to make a button to sort a list based on some variables, how would I tackle this? Is it intermediate, doable by a beginner (determined to make it work)? Using Kotlin in Android studio wanting to sort a catalogue based on stuff like difficulty, time etc.

    Basically: how to do a "sort by" mechanic?

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

    Don't know what to learn next

    Posted: 30 Jun 2019 04:54 AM PDT

    I've been developing android apps as a hobby in Java for the last couple of years.It seems that the market Is now shifting towards Kotlin. I don't consider myself a beginner on Android,however there are many things i still don't know regarding other aspects.I've created some basic programs in Python but i've never coded using JavaScript or Kotlin. How should i invest my spare time on the next 6 months?Should i learn web developing or kotlin?I know It depends by what i want to do but for example how important Is It for a mobile developer to know JavaScript?
    I'd like to eventually get a job in the mobile world. With JavaScript i might create apps also for IOS and also develop the server side for APIs,whilst with Kotlin it seems to me It doesn't add that much compared to what i can already do with Java.But how bad Is for a mobile developer to not knowing Kotlin in 2019?I get the feeling that i've learnt Java for nothing,Everyone Is talking about Kotlin these days.
    Thx

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

    Adding a view in a custom view is not aligning it to its parent start/top

    Posted: 29 Jun 2019 07:37 PM PDT

    Im building a custom view and I have a loop that generates a whole bunch of regular views. Everything aligns perfectly but the very first view generated. That one leaves a margin between the beginning of the parent and itself. All the other views are aligned to the next view normally creating the stack of view that I need.

    Ive debugged using the layout inspector and dont see ay type of margin. Ive checked both xml and kotlin code and havent added any margins/padding there. What could be the issue?

    code:

     var layoutParamsIntervals = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, rowHeight / amountOfIntervalsPerHour) //debugging, trying anything layoutParamsIntervals.leftMargin = 0 layoutParamsIntervals.topMargin = 0 layoutParamsIntervals.bottomMargin = 0 layoutParamsIntervals.rightMargin = 0 layoutParamsIntervals.marginStart = 0 layoutParamsIntervals.marginEnd = 0 // if the previous view is not null we align thew view to the start of the parent view if(previousView != null) { layoutParamsIntervals.addRule(RelativeLayout.BELOW, previousView.id) } else { layoutParamsIntervals.addRule(RelativeLayout.ALIGN_PARENT_TOP) layoutParamsIntervals.addRule(RelativeLayout.ALIGN_PARENT_START) } val interval = ViewInterval(y, INTERVAL_TYPE.WHITE, context, this::intervalPassedOver)//TextView(context)//View(context) interval.id = offset interval.setBackgroundResource(R.drawable.interval_border_solid_dotted_top) // appending to the parent ll_intervals_container.addView(interval, layoutParamsIntervals) offset += 10 // using this as ids for now previousView = interval viewIntervals.add(interval) 
    submitted by /u/foxdye96
    [link] [comments]

    Is it possible to set up an app that automatically donates all of the money I collect?

    Posted: 29 Jun 2019 09:30 PM PDT

    I want to do something raise awareness for the state of living for the severely disabled in the U.S and I wonder if I can set it up so that when people buy my app the money automatically is donated. I don't want to just give people my word and promise Ill donate what I make because it's my first app and I want people to know I am not scamming them.

    Is there a feature to let google automatically donate this money people pay for your app? I don't even need to touch that money or see it, just let Google handle it.

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

    Want to use the old version of the piggy sticker in whatsapp

    Posted: 30 Jun 2019 06:09 AM PDT

    Can someone perhaps create a sticker for it and put it inside an app of his?

    https://emojipedia.org/whatsapp/2.17/pig/

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

    Can't run my emulator on intel gpu

    Posted: 30 Jun 2019 12:23 AM PDT

    Whenever I try to run my app the emulator won't work and show (GPU driver issue).

    There is to GPUs in my laptop intel(R) Hd and amd. How can I run the app on AMD GPU.

    I'm new to programming, so I hope if you can help me

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

    I am trying to install Android 9 on a Moto G6 and I am not sure what file to use. Can you guys help me?

    Posted: 30 Jun 2019 09:48 AM PDT

    Allow Wi-Fi Multicast Reception!

    Posted: 29 Jun 2019 05:04 PM PDT

    Firstly im not a dev or anything at all about programming or making apps im just looking for a answer to a question if anyone would be kind enough to answer in the most simplistic terms.

    Recently I've been interested in a app its a drum app a very good drum app but the dev has set dodgy permissions like allowing camera access and gps location which doesn't make sense at all for a Drum app!

    Those i can block the permissions too on android but there's a permission i cannot block called Allow Reception of Wi-Fi Multicast which from the few descriptions ive read online as non app developer and looking at the other nonsensical permissions seem very suspicious!

    So please could somebody possibly explain this permission like im a 5 year old and tell me if its safe?

    Sorry for hassle and thanks for your time.

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel