• Breaking News

    Friday, October 30, 2020

    Android Dev - Weekly "anything goes" thread!

    Android Dev - Weekly "anything goes" thread!


    Weekly "anything goes" thread!

    Posted: 30 Oct 2020 05:40 AM PDT

    Here's your chance to talk about whatever!

    Although if you're thinking about getting feedback on an app, you should wait until tomorrow's App Feedback thread.

    Remember that while you can talk about any topic, being a jerk is still not allowed.

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

    How can I do custom notch on CardView like this?

    Posted: 30 Oct 2020 01:28 AM PDT

    Avoiding I/O in gradle ?

    Posted: 30 Oct 2020 08:22 AM PDT

    I have seen some threads recommending that you avoid I/O during gradle configuration. My company currently does this to get the branch name, build time, and git SHA, into BuildConfig. I'm trying to understand the reasoning of why I should avoid it before I bring it up to my coworkers.

    For these specific examples I replaced the git command with a static string, and did ./gradlew assemble* --dry-run --rerun-tasks --profile and those configuration times dropped from around 3s to 1.5s. that's a nice percentage but not all that significant since that's only for configuration.

    What else should I know? I have read some threads alluding to impacting incremental builds but can't find concrete info about why

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

    Scrollytelling on native Android?

    Posted: 30 Oct 2020 04:57 AM PDT

    There are quite a lot of websites out there that use scrolling as an element of storytelling (scrubbing through a video, pinch into images, etc.). A good example for that is this website: AirPods Pro (sorry for the Apple reference).

    For a project we're trying to accomplish something similar, but native. I haven't come across many Android related references but came up with a few options:

    Build the website and wrap it in a WebView.
    Pro: We could use it for several platforms
    Contra: I think the UX will suffer quite a bit from that. Also, we need a click interaction to trigger sound.

    Use a list (like RecyclerView) with video players and some custom views
    Pro: Native experience
    Contra: Not sure if this is feasible. f.ex. linking the video progress to scroll is either very hard or not possible after all.

    Does anyone of you already accomplished something similar or has some tips how to create such an experience?

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

    Leak detection: Android Studio vs LeakCanary

    Posted: 29 Oct 2020 05:21 PM PDT

    ConstraintLayout 2.0.4

    Posted: 29 Oct 2020 04:04 PM PDT

    Multiple Ad Banners for every Fragment vs Single Shared Ad Banner. Revenue difference? (AdMob or others)

    Posted: 30 Oct 2020 05:55 AM PDT

    So I was curious whether it makes a difference, in terms of revenue, to show a different Ad Banner on every Fragment or if it would get the same results as just showing the same one from the Activity.

    I'm not sure if I explained myself properly:

    OPTION 1:

    Activity1->[no ad banner]

    • Fragment1->AdBanner1
    • Fragment2->AdBanner2
    • Fragment3->AdBanner3

    OPTION 2:

    Activity1->AdBanner1

    • Fragment1->(same AdBanner1)
    • Fragment2->(same AdBanner1)
    • Fragment3->(same AdBanner1)
    submitted by /u/cmlui
    [link] [comments]

    Java 9+ support for Android projects is being worked on

    Posted: 29 Oct 2020 07:56 AM PDT

    I made a library alternative to CustomTabs

    Posted: 29 Oct 2020 10:33 PM PDT

    The main reason to develop this was the fact that CustomTabs needs a service provider installed in the device to launch the tabs eg: Chrome, Brave, etc.

    So I made my own version of it which uses WebView to load pages. Plus, it supports private browsing & dark mode (for API >= 29).

    Any suggestions & improvements are most welcome!

    Github

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

    Please help devs.

    Posted: 30 Oct 2020 07:58 AM PDT

    Please help devs.

    Hi we are having a game called "The last roman village" on Google play. for the past 2 days we have all refunds and canceled transactions which is unbelievable. Mostly of them from South Africa. I also noticed that several user issued like 8 refunds which is impossible. Anyone else experience the same?

    The image shows 1 user only refunded soo many times

    https://preview.redd.it/bxltc0dxy8w51.png?width=1505&format=png&auto=webp&s=70a8c817db0e52def6dd15f50ed51910391339bd

    Thanks all

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

    Google Elevation APIs

    Posted: 30 Oct 2020 01:51 AM PDT

    Hello! We will have our project at Microwave Design, which one of the crucial data we need to get is the ELEVATION.

    Fortunately, Google offers such API: https://developers.google.com/maps/documentation/elevation/overview.

    But I don't really get the...

    "Pay only for what you use.

    Our pricing scales to fit your needs with no commitments, termination fees, or usage limits — and you can use mobile Maps at no charge."

    Does it mean that I will get charged ONLY for every request? or does google will charge me EVERY month? So it means that my card would not be credited unless the bulk number of requests on API happens?

    Since I will be only using this API for around 100 to 500 requests. Thank you!

    PS. Im using a python script to extract data.

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

    I need ideas for features for a mobile app that teaches programming in Minecraft.

    Posted: 30 Oct 2020 05:02 AM PDT

    What kind of features and functionalities should I integrate into an app that is teaching programming in Minecraft? So far I have quizzes and explanatory videos and I need a lot more.

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

    AR Core Android Tutorial without Sceneform?

    Posted: 29 Oct 2020 08:05 PM PDT

    Hi everyone!

    I am new to ARCore and it seems that most tutorials I find are related to Sceneform. However, sceneform doesn't seem to be supported in the newer versions of Android Studio ( which can only mean that it is being dropped eventually ). So it would really help me if there were some tutorials on ARCore android development without Sceneform.

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

    kotlinx.coroutines 1.4.0: Introducing StateFlow and SharedFlow

    Posted: 30 Oct 2020 04:24 AM PDT

    Have to delete .gradle every other build

    Posted: 30 Oct 2020 03:30 AM PDT

    Basically what the title says here. After updating to Android Studio 4.1 I've had to delete the .gradle folder after every other build. I get a class not found on dexpathlist error on the second build for some reason. This is with no actual code change to the project. Any suggestions here?

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

    Making A Minimalist Smartphone

    Posted: 29 Oct 2020 06:42 PM PDT

    Hi guys,

    I'm planning on making a custom ROM for android that will essentially be completely normal aside from being entirely unmodifiable. My main goal is to curb my own smartphone addiction by taking control away from my future self (making it impossible to download youtube, reddit, instagram, etc.) and seeing as how I'm very new to the backside of Android I was wondering if anyone had any tips on how I might be able to do this. Is there any specific smartphone that might be easier to modify than others? Maybe one with a notoriously straightforward root process? Is there an easier way to do this than by rooting and modifying a phone? Any and all information is welcomed.

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

    Heads up notification in android O and higher

    Posted: 29 Oct 2020 10:28 PM PDT

    How can I get a head-up notification in android O and higher here is my notification code

    private void createMarkNotification(String path) {

    long currentTime = utilityClass.GET_CURRENT_TIME();

    Intent intent = new Intent(getApplicationContext(), x.class);

    intent.putExtra(utilityClass.CONSTANT_INTENT_FOR_MAR_NOTIFICATION, path);

    intent.putExtra(utilityClass.CONSTANT_ID_FOR_MAR_NOTIFICATION, currentTime);

    PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(), (int) currentTime, intent, 0);

    Notification notification = new NotificationCompat.Builder(this, xyz)

    .setSmallIcon(R.drawable.ic_launcher_foreground)

    .setContentTitle("blab blab")

    .setAutoCancel(true)

    .setDefaults(Notification.DEFAULT_ALL)

    .setPriority(NotificationCompat.PRIORITY_HIGH)

    .setColor(ContextCompat.getColor(getApplicationContext(), R.color.colorAccent))

    .addAction(R.drawable.ic_launcher_foreground, "xyz", pendingIntent).build();

    NotificationManager notificationManager = (NotificationManager)

    getSystemService(Context.NOTIFICATION_SERVICE);

    notificationManager.notify((int) currentTime, notification);

    }

    and I'm creating a notification channel in app class

    private void createNotificationChannel() {

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

    NotificationChannel channel = new NotificationChannel(CHANNEL_ID_FOR_SERVICE,
    utilityClass.NOTIFICATION_CHANNEL_NAME_FIRST, NotificationManager.IMPORTANCE_DEFAULT);

    NotificationChannel channel2 = new NotificationChannel(xyz,
    utilityClass.NOTIFICATION_CHANNEL_NAME_SECOND, NotificationManager.IMPORTANCE_HIGH);

    NotificationManager manager = getSystemService(NotificationManager.class);

    manager.createNotificationChannel(channel);

    manager.createNotificationChannel(channel2);

    }

    }

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

    AdMob violation - Scraped content. How to proceed?

    Posted: 29 Oct 2020 05:24 PM PDT

    Hi,

    This is not a post to complain, I just seek advice on the best course of action.

    I have an app that allows the user to authenticate with Spotify only. It gets and saves the user location and the list of the last played songs by the user using Spotify API, then it builds a list of the most played songs in a certain radius around the user's location. In short, it shows the most played tracks by other users of the app given a certain radius from the user.

    Today I received an e-mail from AdMob stating that ad serving for my app was restricted for a policy violation: "Scraped content". They demand I fix the policy violation.

    I see no way to fix this violation, I'd rather just remove AdMob from the app so I don't risk losing the AdMob account. Can it be done? I don't think this is an warning that can be ignored, it demands some action.

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

    Migrating the deprecated Kotlin Android Extensions compiler plugin to ViewBinding

    Posted: 30 Oct 2020 01:52 AM PDT

    Big'O Notation Visualizer Android App (Kotlin)

    Posted: 29 Oct 2020 12:58 PM PDT

    I see lots of algorithm visualizers but few that focus on space and time complexity. I decided to make my own Android app to visualize this and to add to my resume. I did create a nice gradient effect for the main page that's pretty boilerplate if you want to add changing background gradients to your projects. New devs feel free to look at the code and learn from it. Experienced devs I would appreciate any feedback on the code for it. I would love feedback from the community and I am happy to answer any questions as well!

    Source Code: https://github.com/justingeist0/big-o-notation

    Google Play Page: https://play.google.com/store/apps/details?id=com.fantasmaplasma.bigonotation

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

    Get current TV channel

    Posted: 29 Oct 2020 03:19 PM PDT

    I have built an app for Android TVs that among other things sends an email when a button is pressed. Among the rest of the tasks I'm trying to get the current channel the user is watching, but I can't seem to get a solid answer anywhere, any ideas?

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

    How to fix the pain of modifying Kotlin nested data classes

    Posted: 29 Oct 2020 08:46 AM PDT

    In-app Updates: be prepared for the critical-bug-case

    Posted: 29 Oct 2020 04:25 PM PDT

    Activity launcher (tutorial) not working

    Posted: 29 Oct 2020 08:07 PM PDT

    I'm following this tutorial except I am not modifying for "baseactivity".

    I created a function as below:

    /**
    * Extension for smarter launching of Activities
    */
    inline fun <reified T : Any> Context.launchActivity(
    noinline modify: Intent.() -> Unit = {}
    ) {
    val intent = Intent(this, T::class.java)
    intent.modify()
    intent.addFlags(FLAG_ACTIVITY_NEW_TASK)
    startActivity(intent)
    }

    I am trying to call this code in another function :

    fun checkPic(): Boolean
    {
    if ( globalV == 24 )
    {
    launchActivity<MainActivity2>()
    }

    return false
    }

    I'm getting an unresolved reference to launchActivity.

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

    Make the development of Android app easier : HMS Core plugins dedicated to third party platforms

    Posted: 29 Oct 2020 07:49 PM PDT

    No comments:

    Post a Comment