• Breaking News

    Monday, February 3, 2020

    Android Dev - Weekly "who's hiring" thread!

    Android Dev - Weekly "who's hiring" thread!


    Weekly "who's hiring" thread!

    Posted: 03 Feb 2020 04:44 AM PST

    Looking for Android developers? Heard about a cool job posting? Let people know!

    Here is a suggested posting template:

    Company: <Best Company Ever>
    Job: [<Title>](https://example.com/job)
    Location: <City, State, Country>
    Allows remote: <Yes/No>
    Visa: <Yes/No>

    Feel free to include any other information about the job.

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

    Weekly Questions Thread - February 03, 2020

    Posted: 03 Feb 2020 02:57 AM PST

    This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, our Discord, 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 this week's thread? Click this link!

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

    Complex UI/Animations on Android — featuring MotionLayout

    Posted: 03 Feb 2020 03:09 AM PST

    Understand your players better with affinity learnings

    Posted: 03 Feb 2020 12:52 AM PST

    Android 10: open file in Download folder (received via Nearby Connections API)

    Posted: 03 Feb 2020 12:23 AM PST

    Hi.

    I have several Android 10 devices with my app targeting api 29 and I want to capture an image from one or more devices and send it to a 'master' device which will then open the images and upload to a server, and I figured Nearby Connections API would be the perfect fit - or so I thought.

    I am following this guide and the connection and transferring of the image file works just fine. Trouble is the file is placed in a 'Neaby' folder in 'Downloads'. I figured I should use MediaStore.Downloads and I would then be able to access files created by my app, but I don't get any results when doing the following:

    requireActivity().applicationContext.contentResolver.query( MediaStore.Downloads.EXTERNAL_CONTENT_URI, arrayOf(MediaStore.Downloads.DISPLAY_NAME), null, null, null ).use { cursor -> while (cursor.moveToNext()) { //Not reaching this point :/ } }

    I use "com.google.android.gms:play-services-nearby:17.0.0".

    Lowering target api or setting android:requestLegacyExternalStorage="true" are not options ;)

    Am I doing something wrong or is my goal simply not possible with the current state of play-services-nearby?

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

    Published library with helpers for migration from RxJava to Coroutines/Flows and otherwise. Maybe someone will be interested.

    Posted: 03 Feb 2020 06:45 AM PST

    20 Best Android Development Books of 2020

    Posted: 03 Feb 2020 03:27 AM PST

    Error running "App": default Activity not found

    Posted: 03 Feb 2020 07:42 AM PST

    Error running "App": default Activity not found

    Very stupid question but I've been working on this project for two months now and have never had this problem. All online solutions such as

    1. Invalidate caches restart
    2. clean and rebuild
    3. deleting cache folder of android studio
    4. Default activity is mentioned in the manifest

    Has not worked.

    https://preview.redd.it/6ow2xfgcbqe41.png?width=772&format=png&auto=webp&s=7ed0455a6dec6bd219cd07e00884ff9eb55f9545

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

    ConstraintLayout negative margin support

    Posted: 03 Feb 2020 07:42 AM PST

    Why constraint layout removed negative margin support?. Any valid reason? Any alternatives other than negative translation? Is it possible to extend ConstraintLayout and add negative margin support by ourself?

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

    If I want to develop SDK to support cross platform(ex:android, linux) using my codes, do I need to make wrapper layer?

    Posted: 03 Feb 2020 07:41 AM PST

    After I have developed certain features based on android(using java), linux(using c++),

    then If I want to make SDK(library,documents,test tool,etc) that support android and linux.

    But I am confused whether I need to make wrapper layer.

    case 1) Do I need to make wrapper layer to support java(for android) and c++(for linux)?

    1-1) In case of this, I worried that it can cause code complexity and performance issue.

    case 2) If I don't need to make wrapper layer, client should make two application to working on android and linux. In case of this, I think my SDK can not to say to support cross platform.

    currently, I think case2) is more general way and good for performance.

    how do you think about it?

    I wonder how to make most SDK do.(case1? or case2?)

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

    Any pitfalls with Dagger setup implemented using Kotlin in a mixed Java/Kotlin codebase?

    Posted: 03 Feb 2020 07:11 AM PST

    Many companies that used Dagger started a migration to Kotlin (or already migrated).

    However, if I remember correctly, there have been some issues with writing Dagger infrastructure using Kotlin in mixed codebases. I distinctly remember that Lyft had to keep their Dagger-related code in Java for some reason, but I don't remember where I read that (and not even sure it happened).

    So, if I have relatively big project that uses both Java and Kotlin and I want to integrate Dagger into it using Kotlin, are there any pitfalls and nuances that I need to be aware of?

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

    Protected method not accessible from subclass

    Posted: 03 Feb 2020 06:46 AM PST

    Hi everybody, I don't know if this is the right place to ask as this is not strictly related to Android (I suppose, it happened to me in Android and r/Kotlin rules redirected here)

    I have a parent class where a member is declared protected (please, refer to this StackOverflow post whose this is an exact copy)

    class BaseContoller<G: BaseContract.BasePresenter, F: BaseModel> { protected var presenter: G? = null // ... } 

    In each of BaseController's descendants, I refer to presenter with no problem as it is accessible in the same package and subclasses. One BaseController's descendant has to be extended by other classes too but I have to do one check before of performing certain actions in where presenter is referenced again

    class BackupPrinterController<G: BackupPrinterContract.Presenter, F: BaseModel>: BackupController<G, F> private fun startScan() { if(this is PrinterAssociationController) { PrinterConnection.onConnection = { presenter?.onDeviceConnected(it) } // ... } } } 

    The strange behaviour comes here, presenter is perfectly accessible only without the filter if(this is PrinterAssociationController), with that if statement, when the onConnection callback is invoked, an IllegalAccessError exception is thrown by presenter

    Here is the declaration of PrinterAssociationController

    class PrinterAssociationController: BackupPrinterController<PrinterAssociationContract.Presenter, PrinterAssociationModel>(), PrinterAssociationContract.View 

    and here is the exception

    java.lang.IllegalAccessError: Method 'package.common.base.BaseContract$BasePresenter package.common.base.BaseController.getPresenter()' is inaccessible to class 'package.project.features.shared.controllers.BackupPrinterController$startScan$1' (declaration of 'package.project.features.shared.controllers.BackupPrinterController$startScan$1' appears in /data/app/package.project-1/base.apk:classes2.dex) at package.project.features.shared.controllers.BackupPrinterController$startScan$1.invoke(BackupPrinterController.kt:53) at package.project.features.shared.controllers.BackupPrinterController$startScan$1.invoke(BackupPrinterController.kt:35) at package.project.utils.print.PrinterConnection$scan$1$4.accept(PrinterConnection.kt:84) at package.project.utils.print.PrinterConnection$scan$1$4.accept(PrinterConnection.kt:24) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63) at io.reactivex.internal.operators.observable.ObservableFilter$FilterObserver.onNext(ObservableFilter.java:52) at io.reactivex.internal.operators.observable.ObservableDistinct$DistinctObserver.onNext(ObservableDistinct.java:85) at io.reactivex.internal.operators.mixed.CompletableAndThenObservable$AndThenObservableObserver.onNext(CompletableAndThenObservable.java:65) at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.tryEmit(ObservableFlatMap.java:265) at io.reactivex.internal.operators.observable.ObservableFlatMap$InnerObserver.onNext(ObservableFlatMap.java:562) at io.reactivex.internal.operators.observable.ObservableDoOnEach$DoOnEachObserver.onNext(ObservableDoOnEach.java:101) at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62) at io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver.onNext(ObservableUnsubscribeOn.java:60) at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:66) at com.polidea.rxandroidble2.internal.serialization.FIFORunnableEntry$1.onNext(FIFORunnableEntry.java:66) at io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver.onNext(ObservableUnsubscribeOn.java:60) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58) at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:66) at com.polidea.rxandroidble2.internal.operations.ScanOperationApi21$1.onScanResult(ScanOperationApi21.java:77) at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:471) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.osama.firecrasher.FireLooper.run(FireLooper.kt:39) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6780) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390) 

    I don't understand why this is happening when I put that if statement

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

    Have the guidelines for back vs. up navigation changed?

    Posted: 03 Feb 2020 02:49 AM PST

    The guidelines for back and up navigation used to look like this. (Internet Archive)

    However, that same page now redirects to a new page: https://developer.android.com/training/design-navigation/ancestral-temporal

    There is also this new page:

    https://developer.android.com/guide/navigation/navigation-principles#up_and_back_are_identical_within_your_apps_task

    Previously, it was recommended that the back button and the up button should not always have the same behaviour. However, the new advice is:

    Within your app's task, the Up and Back buttons behave identically.

    This seems like a change for the better, but I can't find any announcement for it, which seems strange for such a big change.

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

    Second Google play developer account

    Posted: 03 Feb 2020 06:29 AM PST

    I have a question about registering multiple Google Play developer accounts. Maybe someone have expirience with it. I already have Google Play developer account, it do not have account suspense, strikes, banned apps, etc. But I want have different kind of apps on another account to prevent users who use apps from my first account see apps, that I will publish on another account. I plan to pay for that account with same creadit card and use same ip adresss, computer, but different browser. can I do it without risk to get ban from Google on both my accounts?

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

    [DEV] Star Launcher �� - Themes, Wallpapers, Widgets

    Posted: 03 Feb 2020 06:27 AM PST

    Hello, I want to recommend my launcher and would like to know your first impressions about him.The other day, at the request of my users, I added background hotseat and hide apps function. If you have any suggestions, then be sure to write, I will consider it.
    Link:
    https://play.google.com/store/apps/details?id=com.hypergdev.starlauncher
    ------------------------------------

    Features of Star Launcher:- Notification dots 📨· Star Launcher will show you which applications have active notifications without having to download an external plugin. This makes the function more stable and reliable.

    - Smart Search 🔎· The Star Launcher search bar allows you to quickly find contacts and applications or perform actions such as searching on the Internet, you can also choose your provider: Google, Bing, DuckDuckGo, Yandex.

    - New look of the phone 📱· Choose different themes (light, dark, transparent).· Set background hotseat and customize color search bars.· Personalize applications with a custom icon pack and use responsive icons to make their appearance consistent.· Resize and mesh icons

    - Protect your apps 🔒· You can hide applications, as well as hide the name of applications in the menu and on the desktop.

    - Gesture settings 👆· You can configure gestures to lock the phone with a double tap on the screen, open the application panel by swiping up the screen, etc.

    - Built-in calendar widget 📆· The built-in widget has been redesigned to display information such as the next event and weather.

    All good and positive!

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

    Can you check the activity stack if it contains a certain activity?

    Posted: 03 Feb 2020 12:04 AM PST

    Hello!

    I'm wondering if it is possible to check if the activity stack contains a certain activity to know if this activity has already been launched before? Is it possible to distinguish between activities already launched and activities that have not been launched yet?

    Thank you.

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

    App development (IOS + Android)

    Posted: 02 Feb 2020 06:37 PM PST

    I am new to programming. I want to build an app for both IOS and Android for business purposes. I know there are platforms like flutter where you can build apps for both ios and android. But, my concern is how sustainable would be using platforms like flutter instead developing same app for ios and Android separately. I appreciate your feedback

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

    Best way to manage data in Firestore as an admin ?

    Posted: 03 Feb 2020 02:23 AM PST

    Say I have an app all is setup I just want to filter some data before it goes into the main set manually. Should one make an admin version of the app or use a script on a PC or use cloud functions but then where comes the human decision in functions. Any insight would be appreciated.

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

    Is Picasso Library abandoned?

    Posted: 02 Feb 2020 07:27 AM PST

    The last Picasso library release is about two years old

    A long period considering Square updates its libraries very often

    I'm considering to use Coil in new projects (migrating the older projects is not necessary because Picasso works very fine for me)

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

    Jetpack Compose State

    Posted: 02 Feb 2020 01:47 PM PST

    This tutorial describes the Jetpack compose state system: https://codelabs.developers.google.com/codelabs/jetpack-compose-basics/#4

    Does anyone know what their long term plan with state is? IE how do you handle a more complex state within a larger tree of components?

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

    Separate User Behavior

    Posted: 02 Feb 2020 09:20 PM PST

    Hello everyone,

    I am current a University student and for my final course I am making an Android app that will allow students to tutor other students.

    Right now I am currently researching the details of developing an Android app. One thing I cannot seem to find any really good resources on is how to handle application views/functionality based on user type.

    To clarify that app will have two user types. One being a tutor (providing their services) and the second being a student (consuming services provided). The functionality of the app will be mostly the same, except I want there to be different "views" based on a user's type. Now I know that companies like Uber, where the users fall into very different and distinct types, separate the functionality of different user types into different apps. I.E. Uber has two apps for the rideshare service, "Uber" (used by riders) and "Uber Driver" (used by the drivers).

    Now I could make two separate apps, but seeing how this is just for a class and the entire project is a proof-of-concept of sorts I am trying to avoid taking that route. The only resource I have found that even discuses what I have to accomplish (sort of) is this link. However, this does not seem to be the most elegant way of handling this.

    Now, while I have no experience creating mobile apps I have a tremendous amount of experience with Java, so I am not worried about coding a solution, I just really need some advice/resources on handling this functionality.

    Thank you all for any help. I really appreciate it!

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

    Looking for a free OCR (Optical character recognition) library that works great!

    Posted: 02 Feb 2020 10:19 AM PST

    So imagine taking a picture of an invoice and to be able to read all that data in a meaningful way would be the end goal.

    Any suggestions dev community?

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

    Did your Admob revenue decrease (plummet) after adding mediation?

    Posted: 02 Feb 2020 07:32 AM PST

    I integrated MoPub mediation back in July-August 2019, since then, Admob has been ruthless about CPC that I get for showing their ads.

    In September, my revenue plummeted 50%, with 200% increase in impressions from Admob. The reason being, they provided around $0.06 CPC for my traffic which mostly comes from USA/Germany.

    I turned off Admob from MoPub in mid September, and moved to Facebook Audience network, and with them, I'm making almost double the income that I'd have ever made with Admob (even with only 80% fill rate, and my ads are passing quality checks too!).

    Every now and then I turn on the switch for Admob to see if I get proper eCPM and CPC from them, but it has never picked. Yesterday I got the same CPC for US traffic. Is it because I'm using MoPub mediation? Do they have some kind of kill switch for apps that mediate ads (not from their platform).

    I say this because I tried their own mediation solution for a month or two (admob can also be used to mediate ads), but it was f*cking terrible. They literally stole the impressions from Audience network even if Audience network outperformed them by miles! Mediation platforms are supposed to give higher priority to ads from networks which give higher eCPM (auto CPM adjustment thing), Audience network gave around 2X the eCPM, and still admob didn't show their ads. If they have something like "give this guy poor revenue because he mediates his ad using third party platform", then it's freaking terrible. Did anyone face the same issue? Or is it just me?

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

    Does the Android system for file manager apps generally support the connection between two Android 10 devices via cable?

    Posted: 02 Feb 2020 05:23 PM PST

    Hello,

    when users connect two Android 10 phones via cable to copy files.

    Only the standard Android Files view (from the Android system: com.android.documentsui) will appear. It is not the pre-installed file manager of the respective Android phone.

    Users have told me that they are looking for a real file manager app for this process. But how can I do that? Currently there is no way to use other file manager apps or the pre-installed file manager of the respective Android phone for this process.

    Do you have any suggestions?

    Does the current Android 10 system for file manager apps generally support the connection between two Android 10 devices via cable?

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

    Jetpack Compose Review (May 2019)

    Posted: 02 Feb 2020 01:33 PM PST

    No comments:

    Post a Comment