• Breaking News

    Thursday, May 13, 2021

    Android Dev - Is there a way to create composition-scoped view model?

    Android Dev - Is there a way to create composition-scoped view model?


    Is there a way to create composition-scoped view model?

    Posted: 13 May 2021 05:59 AM PDT

    I am playing with compose really like it. There is a way to obtain a view model from inside composables, but as far as I understand, this view model will be stored in the activity / fragment scope. Please correct me if I'm wrong.

    What if you have a single activity app with everything written in compose. There are no fragments and if I want to have a separate view model for each screen, they will all live in the activity scope. But what I want is to clear() view model as soon as it's screen has left composition.

    I can see that view models are stored inside LocalViewModelStoreOwner. And there should probably be a way to provide your own composition-scoped ViewModelStore by overriding it. How to do it? Maybe there is already a way for that in the library?

    One extra thing: I am transitioning from fragment based to compose. And I want my view models to still extend ViewModel class (at least for now, because some of the view models are also used in other app that is not in compose).

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

    EmojiView Coming? ��️

    Posted: 13 May 2021 06:21 AM PDT

    Emulator can't resolve names if first nameserver line in resolv.conf is ipv6!

    Posted: 13 May 2021 06:08 AM PDT

    I'm currently on Android Studio 4.2 / macOS 11.3.1. It used to work, but something changed (I've changed network settings from wired to wifi, and maybe even the OS, since last running Android Studio) so that none of the emulators could resolve names - not in my app, chrome, google maps, ...

    If I run it from the command line emulator @Pixel_API_28 -dns-server 8.8.8.8 it works fine, so the problem is clearly the nameserver address it's choosing.

    I notice my /etc/resolv.conf had:

    nameserver fe80::blah:blah:blah:blah nameserver 192.168.1.254 

    So just for fun I swapped the lines so the ipv4 address was first, and ... it works again!

    Hope this is useful to someone. I've reported it, so maybe it'll be fixed one day.

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

    Every app name is already taken. Are there any guidelines on what is acceptable in regards to duplicate names?

    Posted: 12 May 2021 09:10 PM PDT

    I'm working on my first Android app. It's a small project that was initially intended for personal use, but it grew into something I believe could be useful to others. And although it's not supposed to be a big deal, I want to give it a cool name and a professional look (to the best of my abilities, I'm fairly new to it all).

    The thing is... Every decent name I can think of, someone's picked it already for something else. Almost always, these are small apps with 10 reviews at most. Still, I can see how it could annoy other developers, even if my app is not competing with them (they all have different purposes).

    Are there good manners I should know about or guidelines on how to proceed? I don't want to do anything morally wrong or to get banned from Google Play.

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

    In App Purchases are paid by my users but in the play console it stays at payment pending for a long time and it goes to payment cancelled. But at user's end the payment was successful and was refunded after 6 or 7 hours. It mostly happens on UPI. Is not registering for GST(Tax in India), the cause?

    Posted: 13 May 2021 03:36 AM PDT

    It happened when users use Gpay, Paytm or other UPI. Also many payments get cancelled in a day, is that common?

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

    Is it possible to not show ad for 15 second after click?

    Posted: 13 May 2021 07:53 AM PDT

    Hii I have implemented a facebook audience banner ad in my app . I want to not show the app for 15 seconds when it is clicked by user. Can i do this? How? Cheers!

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

    Jetpack compose - visual editor

    Posted: 13 May 2021 05:36 AM PDT

    Is there any good visual editor for jetpack compose available? Im used to do every layout with constraint layout. This works pretty good to me because i can exactly implement what my client asked for. Is there maybe any good composition showcase with realy good examples?

    How to you gonna matter the compose?

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

    Your interstital ads interval? How often do you display them?

    Posted: 12 May 2021 10:20 PM PDT

    When "Sensors off" has been engaged, what sensors can be enabled and under what conditions?

    Posted: 13 May 2021 02:52 AM PDT

    I doubt it's none, ever.

    There have to be apps with permissions to bypass it, like find my phone enabling GPS or other deeply integrated system services. It also probably varies depending on device, manufacturer and software versions.

    To the best of your knowledge, when and by what can these sensors be activated if "Sensors off" has been enabled?

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

    rootless ways to Overcome >500mb free space required limit?

    Posted: 13 May 2021 03:47 AM PDT

    Google forces people to have at least 500mb of free space because as if "some crashes may happen" (they actually don't and if they do I can manage that).

    Freed up all space on phone, removed all files, removed all apks, but space used up (probably by internal partitions such as /data /system etc) increases so I can't fucking use phone any more, can't install any app (even from USB, yeah I unchecked the damn "protect device" options), nor enable ADB (because of some other WebView error, which too is related to how google/android works), nor view email (only in Gmail) (without a workaround, nor download files (only in Google Drive) and so on...

    When rooted etc, all this was never a problem, I also even could do all until there was actually 0mb available. Clearly this is a google problem, I wish I (and anybody else) never had to use an android/iphone etc.

    I need to do this to test some app I'd like to develop.

    I can root etc, but I'd rather keep putting it off (as I'm developing a hatred for all this, including anti user technology)

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

    Is this a decent Flutter app?

    Posted: 12 May 2021 07:25 PM PDT

    Is this a decent Flutter app?

    I just published this flutter app to the App Store but I'm not sure if the app is good enough to show on my portfolio (I'm currently looking for a job as a Flutter Dev). So what do you guys think? I'm afraid this app is too simple, but I'm really proud of it. It's a loan simulator that helps people plan their mortgage payments.

    Google Play: https://play.google.com/store/apps/details?id=com.solanofurlan.e_finance

    GitHub: https://github.com/Solano-Furlan/e_finance

    https://preview.redd.it/lxr9bfd3tsy61.png?width=1024&format=png&auto=webp&s=6e1bcc60af2c888e86e98bf87959b081f1b399a5

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

    Just installed Android Studio 4.2 and can't build a project because of the last Kotlin version

    Posted: 12 May 2021 07:46 PM PDT

    I've been looking for solutions for Kotlin 1.5.0-release-764 and nothing seems to work.

    Try #1:

    I have modified this line:

    ---------------------------------------------
    buildscript {
    ext.kotlin_version = "1.5.0-release-764"
    ---------------------------------------------

    leaving only "1.5.0". I got the following message:

    An existing connection was forcibly closed by the remote host.

    Try #2:

    I have changed the following line:

    ---------------------------------------------
    dependencies {
    classpath "com.android.tools.build:gradle:4.2.0"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
    ---------------------------------------------

    Android Studio ended up crashing and I had to open it again.

    Try #3:

    Went to Tools > Kotlin > Configure Kotlin in Project and changed the version to Kotlin 1.5.0, the following message appears:

    only buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed

    Also, I can't change to the previous version, as it says when I click in Configure Kotlin in Project:

    There aren't configurators available.

    Try #4:

    I move the plugins{} code below the buildscript{} one and the following message is printed:

    Cannot add task 'clean' as a task with that name already exists.

    and quotes this code:

    ---------------------------------------------
    task clean(type: Delete) {
    delete rootProject.buildDir
    }
    ---------------------------------------------

    I had ran out of things to try.

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

    Anyone else getting this error when trying to upload app bundle "There was an error uploading the Android App Bundle. Try again later or contact Google Play developer support if the error persists."?

    Posted: 12 May 2021 05:35 PM PDT

    I tried to upload an aab file today and it gave me that error. Tried incognito, same deal, tried a different browser, same deal. Tried and apk and also got an error (different error: "We could not save your changes. Please try again").

    Play Store support says my bundle must be incompatible. Only change I've made is updating to AS 4.2 and whatever gradle updates that suggested. I released an update just fine yesterday but don't think I had done all the AS updates yet.

    I tried installing the apk with adb and it worked just fine.

    Anyone else having issues?

    Edit: today I tried the same bundle and it worked.

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

    Tips on choosing a library

    Posted: 12 May 2021 04:34 PM PDT

    Hey there!

    I am soon starting my first android dev job ( 🥳, self-taught, had to say it 😁 ), so I am pretty much a noob.

    I wonder how you guys choose a library, except for those very well known ones, of course. Having read in OOP there is no need to reinvent the wheel, it makes more sense to find a library that already gets the job done (?).

    Specifically I wanted to create an email app, more or less from scratch. I found a few libraries and after a rough search on how to pick a library, I sorted them by stars and wanted to go from there.

    But more generally, how do you pick a library?

    Thank you for any input 😊

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

    How to live better without Dependency Injection

    Posted: 12 May 2021 03:33 PM PDT

    Drawing Overlay graphics (lines), can under-app tell this is being done?

    Posted: 12 May 2021 10:26 AM PDT

    I have an idea for an app that would help people with certain kinds of games, like pool. You would be able to quickly draw lines on top of the game to see your angles better.

    However, my concern would be whether or not the underlying app can tell that there is an overlay, which could get the person's account removed for TOS violation.

    There's presumably two ways they might be able to do this.

    1. Query all running apps, and see if a blacklisted app is running.

    2. Do screen captures, compare with expected image, and if there are any differences, send that back home.

    I'm not too concerned with #1. I'm primarily concerned with the ability of an underlying app being able to do #2. Without any special permissions, can an underlying game app do number two? What permissions would it need in order to do #2?

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

    No comments:

    Post a Comment