• Breaking News

    Tuesday, November 2, 2021

    Android Dev - Weekly Questions Thread - November 02, 2021

    Android Dev - Weekly Questions Thread - November 02, 2021


    Weekly Questions Thread - November 02, 2021

    Posted: 02 Nov 2021 07:00 AM PDT

    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]

    Announcing Kotlin support for protocol buffers

    Posted: 01 Nov 2021 02:12 PM PDT

    Making Simple Android Chat App

    Posted: 02 Nov 2021 12:29 AM PDT

    How do I open source an app without making it completely useless?

    Posted: 02 Nov 2021 02:22 AM PDT

    I have an app which I'm looking to open source, but the issue is, I'm using my servers to host literally all the content from the app.

    Some of the data is hosted on Firebase, and most of it is on my own shared hosting.

    Now if I open source it, I'll obviously have to get rid of Firebase, which makes Notifications and database useless (where 60% of the app content is). And then I don't want copycatters to be able to use my hosting bandwidth and API's, so I'll have to get rid of my endpoints and auth mechanism too, which makes the rest 30% of the content inaccessible/useless.

    I can choose to not remove my servers endpoints, but my hosting is already choking up under current load.

    So the only thing that will end up on github would be UI, which is useless without all the backend.

    So how do I open source this sort of thing? I believe users would want to compile the app from source to be truly able to make it "open source", otherwise it doesn't serve its true purpose. Do I just not open source it?

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

    Weekly "who's hiring" thread .

    Posted: 02 Nov 2021 05:06 AM PDT

    Looking for Android developers? Heard about a icy 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/littlekathyxox99
    [link] [comments]

    Adding TextViews using binding adapters, text wont ellipsize

    Posted: 02 Nov 2021 07:12 AM PDT

    So I basically have a binding adapter that will add text views to a linear layout, now the problem I am having is that no matter what I try to do, the text wont ellipsize/start another line if there is too much text. The text simply gets cut off.

    This is the code I am using

    @BindingAdapter("legendAllocations", "legendAllocationsType") fun LinearLayout.bindAllocationLegends(allocations: List<Allocation>?, state: AllocationState?){

    if(allocations == null || state == null) return removeAllViews() val contextLegendItemStyle = ContextThemeWrapper(context, R.style.LegendItem) var other = 1.0 allocations.take(maxAllocationsDisplay).forEachIndexed { index, allocation-> if(allocation.percent != 0.0){ TextView(contextLegendItemStyle).apply { maxLines = 2 ellipsize = TextUtils.TruncateAt.END text = context.getString(R.string.allocations_legend, (allocation.percent?.toPercentString(true) ?: "0%"), allocation.name) compoundDrawableTintList = ColorStateList.valueOf( context.getColor(colorRes[state]?.get(colorIndex) ?: R.color.othersGray)) addView(this) } } } 

    As you can see, I added maxLines, and I have added ellipsize but it does nothing.

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

    Android distribution dashboard

    Posted: 02 Nov 2021 06:28 AM PDT

    I know Google doesn't provide the chart anymore on their site and although they refer to Android Studios "New Project Wizard", according to it, Android 11 and 12 don't exist yet - so its useless.

    They also recommend we look into the app stats on the Play Console, what about people who don't have any apps yet on the Play Store? Android distribution is basically completely unknown at this moment unless you have an established app downloaded by millions worldwide.

    How do people nowadays get that information if they want to publish their first app?

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

    Can someone suggest how to create a similar animation of the transition of the search bar as in the mobile application Gmail?

    Posted: 02 Nov 2021 04:59 AM PDT

    I tried to follow the examples from Material Motion, but it doesn't give exactly the same result. I am inclined to believe that this is probably some kind of Custom View. But at the moment there are no ideas how it can be recreated.

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

    How do you present different UI to different roles?

    Posted: 02 Nov 2021 01:51 AM PDT

    One tedious option is to have multiple apps for different roles like Uber driver vs customer. Another is having multiple activities that share Fragments so you launch activity based on role. Am not sure if there are others, hence the question: How do you present different UIs based on logged in user role?

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

    Anyone else getting really annoying warning for pre-launch reports regarding permissions?

    Posted: 01 Nov 2021 07:11 PM PDT

    The last two betas I've uploaded have had warnings about my app asking for location permissions and allowing clear text traffic.

    What Google is totally ignoring here is that my app is a web browser. It has the same exact location permissions on the manifest as Chrome and the same exact clear text network configuration as Chrome.

    Location - They say that less than 1% of similar apps request this. I doubt that, most browsers need location. Lots of sites have blocks based on location. I hate the idea of asking for location permissions, in fact I didn't use to and I used to get 1 star reviews from users of sites that required it. I only request it on Android 6+ so the user at least has a choice and I only request it once a website asks for it.

    Clear text traffic - What am I supposed to do about http websites?

    I usually take those pre-launch reports seriously but this is going to make it so I start ignoring them, surely that isn't the outcome they want?

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

    Better tooling to build widgets - Glance abstracts RemoteViews with Compose syntax

    Posted: 01 Nov 2021 01:45 PM PDT

    What is the alternative to adMob? Can't get them to trigger a crawl of my app-ads.txt file

    Posted: 02 Nov 2021 12:32 AM PDT

    very annoying that there appears to be no support from adMob. Been a week and I have double checked my site and there is no reason it shouldn't work. Didn't get any help from the community forum. don't know where to turn for help.

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

    Google Maps Directions

    Posted: 02 Nov 2021 02:39 AM PDT

    My app uses Maps API to guide people where to go. However I would like it to be more assisting, in the same way Google Maps does it after you press 'start'. They use traffic information to color code the polylines, they will reroute if you drive wrong, there are instructions at the top that update in real time ("200m take a right"), the voice speaks. Is it possible to implement this detailed assistance in my app with the current API? Otherwise I might have to settle for a link to open Google Maps or Waze outside of my app, but I'd like to avoid that if possible. Appreciate the advice.

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

    Retrofit: Null value in Field is dropped on Put / Patch Request

    Posted: 01 Nov 2021 03:56 PM PDT

    Hello there,

    I read everywhere that null values in Fields simply get dropped and that they do not get send in Put / Patch requests.

    But is there actually a way to send null values?

    Thanks for your information.

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

    Compose for Wear OS: Navigation

    Posted: 01 Nov 2021 11:41 AM PDT

    Where to look if I want to get started with WiFi management

    Posted: 01 Nov 2021 07:01 PM PDT

    So I want to make an app that when connected to specific wifi it can keep track or logs of how much bandwith the device has used(to that specific wifi). And the app can turn off the wifi connection when a certain bandwith has been reached.Problem is I have no idea how to work hardware components such as wifi , Bluetooth and so forth.I have interacted with web Api's but nothing to do about local device Apis ,,if that's even a thing lol.So can I get some resources to read up or documentations to get me up to speed.I have looked over the google codelabs but I couldn't find anything substantial with dealing with raw wifi.

    In Short: Need links to resources or documentations that explain how to work and interact with the Wifi of the device.Im trying to make an app that can profile bandwith used for wifi networks.

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

    I want to apply for "Designed for Families" program but app have a link button to my playstore page which have +18 apps about lotto game predictions. Would that be a problem ?

    Posted: 01 Nov 2021 01:48 PM PDT

    Question in title.

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

    High school android development.

    Posted: 01 Nov 2021 09:18 AM PDT

    Hi, I'm currently trying to get the proper language for my highschool students for cross system library, but with focus on Android, so more like mobile development than desktop. There are tons of possibilities... My students starts object oriented programming two months ago, that's why I have a little concerns about best language choise.

    My first choose was to to get into Kivy, but later I found out about Flutter/Dart. There are also a Apache Cordova, and of course React (which looks like more complicated because You have to know html/CSS/JS).

    What lib/language You can recommend for totally beginners?

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

    App developers and publish help

    Posted: 01 Nov 2021 08:40 AM PDT

    So I just finished developing a chat app so what is next step I'm confused at this point Do I need to rent a server Do I need lawyers to right down my app privacy and policy Please I'm confused.com I done few research but nothing The app is nearly finished thank you.

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

    Using git from Android Studio. A quick guide.

    Posted: 01 Nov 2021 01:07 AM PDT

    No comments:

    Post a Comment