• Breaking News

    Tuesday, November 23, 2021

    Android Dev - Weekly Questions Thread - November 23, 2021

    Android Dev - Weekly Questions Thread - November 23, 2021


    Weekly Questions Thread - November 23, 2021

    Posted: 23 Nov 2021 06:00 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?

    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]

    Talking about the problems of Jetpack Compose with Gabor Varadi

    Posted: 23 Nov 2021 01:07 PM PST

    I usually don't post my videos here, but I think this podcast interview with u/zhuinden could be interesting for some people here. We talk about the problems of Jetpack Compose, why he dislikes MVI, the navigation library, and more:

    https://www.youtube.com/watch?v=RZLI4_1MZ5E

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

    What alternative to crowdtesting platforms are there?

    Posted: 23 Nov 2021 05:43 AM PST

    Hi everyone!

    We're in the final stages of developing our mobile app - and we understand that with a massive variety of devices, we need more testing than our team could provide. We tried to engage friends and family in testing the app, but we mostly received design advice. And although it was practical, professional skills and critical testing analysis are more welcome.

    We want to eliminate as much as possible any chance of crashing and also any usability-related issues. Let's be honest; people are unwilling to return to a product that disappointed them, much less pay for it. I myself prefer to use only the apps that meet my requirements and don't burden myself with writing reviews and providing feedback, simply deleting the application from my phone.

    We'd like to have a clean product when launching, without any significant functional bugs, so our first customers could advise it to their friends and relatives, attracting new clients for us (we hope to lower the costs for marketing this way). That's why I'm thinking of using some of our testing budget to engage a mobile app testing company I previously used in my older projects that could help us with quality feedback, test on numerous devices, and solve any potential issues before entering the market. Global App Testing was an excellent tool in my previous practice saving our time.

    But my colleagues insist on exploring alternative solutions even if I'm pretty skeptical about the idea of hiring someone from Upwork or Fiver. I doubt that a single person has many devices to give us a complete picture, not to mention location QA.

    But we'd be grateful if you could let me know about any other efficient way besides professional QA that could help us make tests on a wide range of devices and locations. We'd appreciate any advice you could provide. Thanks.

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

    What software to create app icon? Illustrator? Photoshop? Paint?

    Posted: 23 Nov 2021 05:40 AM PST

    Best way to test on lots of different screen sizes?

    Posted: 23 Nov 2021 06:48 AM PST

    I don't have access to multiple physical devices and creating lots of emulators seems very cumbersome. Is there a (preferably free) tool that will show what my UI will look like on various screen sizes?

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

    Sticker - package for Gboard?!

    Posted: 23 Nov 2021 02:24 PM PST

    Hey guys,

    could someone help me please & create an own sticker package for me.

    I have all the needed images (both: webp & png - files).

    Thanks in advance for your help!

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

    Testing - education resources?

    Posted: 22 Nov 2021 11:13 PM PST

    Hey devs! I've built several apps through Android Studio. I'm trying to learn how testing works, but the Google lesson in Udemy is full of problems and basically unusable at this point. Are there better resources/education materials you'd recommend?

    Be kind; I've only been at this for about two years and I'm very aware of how little I know.

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

    Android 8.0 or 8.1 emulator (x86 image) on Apple M1

    Posted: 23 Nov 2021 09:38 AM PST

    How can I run a specific x86 image of e.g. Android 8.0 within AVD on Apple M1 system?

    There is no official arm image of those versions. When I run such emulator I get this "The emulator process for AVD Smth_API_26 has terminated".

    Maybe, someone was already faced with such a problem or have an idea of solution. I would be grateful for any help!

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

    Hands on speed up your building and delivery with CI/CD using Github Actions + Firebase Distribution

    Posted: 23 Nov 2021 05:41 AM PST

    I'd would like to share this repo as a first step for learning and working on a CI/CD Project for Mobile App. You can check it, if you are interested how to start a CI/CD.

    The repository includes, how to build a workflow for running a pipelines which automates your building, code styling, testing and the code analysis. The repo have a building workflow for automating your App Delivery with a Firebase Distribution.

    Android-CICD

    Hope it helpful!

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

    Charles Proxy Config on Android OS 12

    Posted: 23 Nov 2021 12:06 PM PST

    Has anyone got their Charles Proxy to work with the latest Android 12 OS? I setup the proxy, and see the traffic now, and installed the certificate as CA certificate and Wi-Fi certificate but I still can't see SSL content. Can help me with this?

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

    How to add Gift voucher system in your app?

    Posted: 23 Nov 2021 10:53 AM PST

    Gift Vouchers and rewards like discounts on various brand, food delivery, Movie Tickets, Memberships, etc

    How to add this Gift and Rewards system into your app? Is there any site that collabs with various companies and offers vouchers system ?

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

    Small sized foreground notification looks good on Android 10 and 11, but on Xiaomi Redmi Android 9, it looks bad

    Posted: 23 Nov 2021 10:01 AM PST

    I'm trying to display small sized foreground notification(20dp). It works good on Android 10 and 11, but on Xiaomi Redmi Android 9, it is displayed, but under the notification, there is 30dp empty space, which makes my notification 50dp-60dp long instead of 20dp. I would like to know if it is because Android 9 doesn't support small sized notifications, or because of Xiaomi OS modifications, and if there is a fix for this.

    Here is my code for displaying custom foreground notification:

    RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_push); contentView.setImageViewResource(R.id.image, R.drawable.someimage); Notification notification= new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) .setContent(contentView) .setCustomContentView(contentView) .setCustomBigContentView(contentView) .setPriority(Notification.PRIORITY_DEFAULT) .setSmallIcon(R.drawable.someimage) .setColor(Color.LTGRAY) .setColorized(true) .setStyle(new androidx.media.app.NotificationCompat.MediaStyle() .setMediaSession(new MediaSessionCompat(this, "tag").getSessionToken())) .build(); startForeground(1, notification); 

    Here is custom notification layout:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/layout" android:layout_width="wrap_content" android:layout_height="20dp" android:background="@drawable/somebackground"> <!--Some content here--> </RelativeLayout> 

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

    What would be the best way to add a multicolor (light, dark, green, solar, whatever) theme to an app and let user switch between them?

    Posted: 23 Nov 2021 07:48 AM PST

    Free cloud database with frequent data access?

    Posted: 23 Nov 2021 07:32 AM PST

    I have a Firestore based app that doesn't require a huge storage space, but due to the nature of the app there is lots of reading and writing going on (but mostly reading, though). Currently it doesn't have many users (few dozen daily) but it seems like 500 daily users is going to cap the Firestore Spark plan quota and I am not planning on paying for database because this app doesn't generate any revenue.

    So I want to plan ahead and migrate away from Firestore.

    Can you recommend me anything that suits my usecase? It doesn't even matter if it's relational or NoSQL, but it should support Google Sign-In.

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

    How to merge multiple modules in a single aar?

    Posted: 23 Nov 2021 03:43 AM PST

    We have modularized our SDK and facing an issue with deploying the SDK aar file, that the SDK-API (the one client's app is integrating) includes other modularized modules, but during maven publish, they should be available, but because there is a delay they are not immediately.

    We might solve this issue by creating **a cron job** in the CI, to check when the inner modules become available. Still, I think maybe it is possible to merge multiple modules in a single SDK? How about **internal dependencies and transitive dependencies**, would they work correctly? Would appreciate any approach.

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

    Sharing objects between foreground service and activity

    Posted: 23 Nov 2021 06:27 AM PST

    I'm interested in sharing some objects between a foreground service (which does not have android:process changed), and my main activity/app. Typically, when just using a bunch of activities/fragments/views, to share between components I would wire up the dagger graph and setup all the injection sites and be good to go. I just don't have a complete understanding how this all works with a service in mind.

    Since I am not specifying another process, I believe the foreground service and app are always running in the same process. Does that mean I can just use dagger like normal and share these objects without thinking of anything more? What happens if the app is killed and the service keeps running - does the service retain the memory of the dagger objects and supply them again if the app starts up again?

    Google recommends the binder approach for same process communication, but it's not clear to me if there is a need to use that over sharing with dagger.

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

    Multiplying two very big numbers results in showing '-1' or '0'

    Posted: 23 Nov 2021 05:51 AM PST

    When i multiply two big numbers (in Double) , for example 2^64 the answer i get from my program is '-1' and when i calculate 2^32 the answer i get from my program is '0'. but when i tried multiplying smaller numbers, such us 2^10 i get the right answer. why is it happening?

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

    Violating the Device and Network Abuse policy when add YouTube API

    Posted: 22 Nov 2021 05:04 PM PST

    My application has been removed from google play and I do not understand the problem or how to solve it. I use the YouTube API to display videos and follow all the guidelines to do so.

    First, an email came with the text: "Your app shouldn't access or use the service or API in a manner that violates its terms of service. For example, your app shouldn't download, monetize, or access YouTube videos in a way that violates the YouTube Terms of Service. "

    Upon appeal, I received the following response: "For example, your app currently contains copyrighted contents from YouTube without consent from the contents' owners. You can refer to the attached screenshot for additional information."

    The screenshot is just one of the videos in my application. But wait, I have added everything according to the YouTube guidelines, and there is also a direct quote from the rules.

    License to YouTube

    By providing Content to the Service, you grant to YouTube a worldwide, non-exclusive, royalty-free, transferable, sublicensable license to use that Content (including to reproduce, distribute, modify, display and perform it) for the purpose of operating, promoting, improving the Service.

    License to Other Users

    You also grant each other user of the Service a worldwide, non-exclusive, royalty-free license to access your Content through the Service, and to use that Content (including to reproduce, distribute, modify, display, and perform it) only as enabled by a feature of the Service.

    Which means that if embedding is enabled by the author of the channel, then I can embed his videos in my application. So what's the problem then?

    Has anyone encountered this? I use the official YouTube player, maybe I didn't notice something and now any embedding is prohibited? But the rules say you can!

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

    Talking about the new Version Catalog Update plugin, how to start with Gradle Plugin dev and more with Hugo Visser

    Posted: 23 Nov 2021 01:53 AM PST

    Adding a widget within the app is inconsistent!

    Posted: 22 Nov 2021 07:32 PM PST

    Adding a widget within the app is inconsistent!

    My concern is that I am unable to figure out beforehand if some devices support adding widgets or not!

    Below is the code snippet I am using to figure out the supported device (or launcher). But still, there are certain cases where the call is made to the `requestPinAppWidget` method but no dialog appears to add the widget (similar to the attached screenshot). Am I doing anything wrong?

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val awm = context?.getSystemService(AppWidgetManager::class.java) as AppWidgetManager if (awm.isRequestPinAppWidgetSupported) { val bundle = Bundle() val rv = RemoteViews(context?.packageName, R.layout.view_widget) bundle.putParcelable(AppWidgetManager.EXTRA_APPWIDGET_PREVIEW, rv) awm.requestPinAppWidget( ComponentName( requireContext(), someClass::class.java ), bundle, null ) } } 

    https://preview.redd.it/wqtdla2fl9181.jpg?width=424&format=pjpg&auto=webp&s=d0f95cf154dbcb9f126515dcd0a7922fddf39a20

    submitted by /u/binary-baba
    [link] [comments]

    Android Basics in Kotlin for Associate Android Developer Certification

    Posted: 23 Nov 2021 12:07 AM PST

    Hi!

    My Company wants me to dive deeper into Android development for a very big Project next year. So they decided that i should do the Associate Android Developer Certificate for a solid knowledge. The way how i learn is my decision and they also pay me courses if i need or want some (ofc theres a cost limit). Ive researched a little bit and didnt found much on that topic. On the official Website they recommend their own Android Basics Course.

    I've made the first two chapter and felt a little bit underwhelmed and it looks a little bit childish. I asked myself if this course really covers all topics deep enough for the exam.

    Has anyone some experience to share on this and if the basics course isnt enough, maybe has some tips if there are any videos out there which cover the exam topic?

    PS: I dont want to be rude or offend someone, but if youre just here to give your opinion if the certificate is necessary or not, please leave. Its nice that you have an opinion but thats not a discussion about the necessity.

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

    Server client between 2 Android devices over USB?

    Posted: 22 Nov 2021 05:35 PM PST

    Is there a way to have two Android devices connected over USB and act as server-client?

    I want one device to send data and the other to receive it over USB. I am thinking gRPC but the support for over USB seems to be limited.

    Any resources I can refer to?

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

    No comments:

    Post a Comment