• Breaking News

    [Android][timeline][#f39c12]

    Wednesday, April 1, 2020

    New RecyclerView API to handle multiple view types: MergeAdapter. Android Dev

    New RecyclerView API to handle multiple view types: MergeAdapter. Android Dev


    New RecyclerView API to handle multiple view types: MergeAdapter.

    Posted: 01 Apr 2020 11:37 AM PDT

    Ask us Anything! We’re the Bumble Android engineering team.

    Posted: 01 Apr 2020 12:19 AM PDT

    Ask us Anything! We're the Bumble Android engineering team.

    This is Bumble's first AMA and we are really excited to be participating in it!

    For those of you who don't know much about us, we are the company behind the dating and social network Bumble and Badoo apps counting half a billion users around the world. Our Android apps are huge, with over 1.3 million lines of code, over 210 million downloads on the Google Play store and an amazing team of 23 people who develop it.

    This is a great opportunity for you to ask any technical questions you may have about developing android apps at this scale, the technical challenges we face, our Open Source projects, articles in our Tech Blog and anything in-between. Please note we're only able to answer questions relevant to the Android development team.

    We will start answering questions from 6pm (GMT+1) but you can already start writing them. We will be here with you guys until 9pm (GMT+1). Check here for other timezones

    ------

    About our developers who will answer you:

    • Anatoliy: Responsible for the registration component in the Android team. You can find me on reddit: u/anatolv
    • Andrei: Engineer, musician. Interested in everything that can be described as software. Working in the Bumble app.
    • Anton: Android engineer in the Badoo features team. Worked on the apps for phones, tablets and even TVs.
    • Arkadii: Born in Saint-Petersburg, Russia. Currently living in London, UK. Started working as a Windows developer in 2008, then switched to Android development in 2012. Passionate about Kotlin Multiplatform, MVI and reactivity.
    • Ivan: Fell in love with programming at school, several years in Enterprise, then Mobile; at Badoo/Bumble since 2013
    • Michael: Android Developer in the Revenue team - we work on ads and payment flows. Keen on Multiplatform Architecture and Rust.
    • Nick: Android engineer in the Core team, mostly focused on mobile infrastructure.
    • Zsolt: Programming since 1996 and on Android since 2.3, at Badoo since late 2016. Working in the platform team on architecture and tooling. Passionate about architecture, Jetpack Compose, and learning about better ways to approach problems. Twitter: @ZsoltKocsi

    ---------

    Proof: https://twitter.com/BadooTech/status/1244635799536250882?s=20

    --------

    EDIT We're now starting to answer your questions!

    --------

    EDIT Thank you Reddit! We enjoyed answering your questions but it's now time for us to close the session - some answers are still incoming. If you have any more questions feel free to leave them below and we will try to answer in the following days.

    https://preview.redd.it/q0ar5yuej9q41.png?width=917&format=png&auto=webp&s=903ec09f2c50105952891e739261e357f68f47d3

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

    April 1st special: WorkManager 2.4.0-alpha02 is now available

    Posted: 01 Apr 2020 12:54 PM PDT

    This release includes a new flexible query API for more complicated use-cases. Check out the release notes at https://developer.android.com/jetpack/androidx/releases/work#2.4.0-alpha02

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

    Is a donate button using IAP system ok in 2020?

    Posted: 01 Apr 2020 08:47 AM PDT

    Ive seen a few discussions about this over the years here via searching. I'm wondering what the current situation is from people who have recent experiences.

    I didnt find anything in the TOS forbidding this, but its Google, so best to ask people what they are actually doing.

    Our game is free.

    We have a donate $1 button if people feel like it.

    It uses Googles IAP system.

    Is this ok in 2020? Will our game be taken down?

    Its really not an important feature to us, if its a risk I will remove it np.

    Thanks!!

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

    Lokking for rxjava2 expert course.

    Posted: 01 Apr 2020 09:43 AM PDT

    Hello. I mastered rx java to medium level and capable to use it from simple Single to complex emitor chain. I am looking for some expert to master more complex situation and to know all of it capabilities and pitdrops

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

    How to deal with pixel 4 corners?

    Posted: 01 Apr 2020 03:00 PM PDT

    I'm trying to add a border around my view but the corners are curved. How did you guys deal with pixel 4 corners?

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

    Using Realm with Recycler view in Kotlin

    Posted: 01 Apr 2020 02:33 PM PDT

    I'm trying to build an app for myself that basically logs specific information for me. I'm also using this as a learning experience for Kotlin.

    This is the flow of data my App:

    Year->Players->Matches

    The app will first open up to a list of Years, in a recycler view, and then each year will have a list of players associated with it, players will their names, win/loss, and other variable data along with a list of matches associated with them. Matches will have data. I am using Realm for it's database functionality.

    I am currently struggling with creating and modifying these datatypes. Here's what a player class would look like:

    @RealmClass open class Player(): RealmObject(){ var name: String? = null var wins: Int = 0 var losses: Int = 0 var matches: RealmList<Matches>? = null }

    Here are my two questions:

    How would I modify matches from the selected player. Lets stay clicking a player in the Recyclerview that shows players, opens up an intent that shows all of the data related to that play. And it also gives the option to add/modify a match how would I link it to that specific initiation of the player class? And it be stored in the way it is shown above respective to Realm.

    What is the best practice to link Realm and a Recyclerview in Kotlin. I followed instructions on how to do it in Java and it worked, but I want to in Kotlin, also RealmRecyerViewAdapter is a thing, again not sure how it would be used in Kotlin. I was thinking of making another class of just lists for data type, and the recycler view would show that list. But with Realm I feel like there's a better way.

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

    In-app Purchasing with Google Play Billing Library

    Posted: 01 Apr 2020 09:57 AM PDT

    There's a couple of things I can't find any info on how to do for my app.

    Posted: 01 Apr 2020 01:03 PM PDT

    Hey fellow developers,

    I'm developing an app which consists of basically a parent control app. This app has two different options: the one for the parent and the one for the child/teenager.

    The parent's app should get information from the child's device and should be able to block apps from being used.

    The child's app should block any apps the parent has banned from being opened, while send the information of the usage of every app to a server. Ideally it should disable the uninstalation of the app behind a password.

    I'm having a couple troubles with the child's side of the app. I've managed to get the information I need with PACKAGE_USAGE_STATS, but there's nowhere on the net that talks about blocking other apps from being used or preventing the app from being uninstalled.

    I've made a service that's constantly looking the foreground package, and if that one is banned, it brings an activity of my own app to the foreground. The problem is that, although it works, it's not reliable, since it doesn't terminate the blocked app and sometimes it doesn't work (looking at the log, I sometimes enter the block app but the foreground package that the service reads is the launcher). Is there some kind of listener to what app is being opened or closed, instead of having something constantly checking?

    I've found the onWindowFocusChanged but since it requires the class to extend AppCompatActivity, I can't put it on my service. Any way to work around that?

    I've found out the existence of WorkManager today, I'm not sure if this is better to deal with these kinds of things? That's what I'll use to daily send information about the device usage to the server, but is it good for this too?

    I've found an app online that does exactly what I'm trying to do, and after trying it out I realised they ask for administrator permissions, probably to have access to closing other apps, but nowhere online I've been able to find information on these permissions and the different things it enables me to do.

    Any help will be good, thank you everyone!

    TLDR:

    Looking to make an app for parental control, having trouble with:

    Blocking other apps from being used

    • Service or WorkManager?
    • Admin permissions, how do they work and where can I find info on those.
    • Is there a listener for foreground activities / opening apps? Or how to use onWindowFocusChanged inside a service

    Preventing the app from being uninstalled with a password

    • Probably should work on the service too.
    • Admin permissions required too, maybe?
    submitted by /u/Stasky-X
    [link] [comments]

    Recycler view is not shotwing anything

    Posted: 01 Apr 2020 09:03 AM PDT

    here are the xml files:

    https://pastebin.com/iREWWmqn

    here is the mainactivity, arrayadapter, and airport code:

    https://pastebin.com/aDwqVJGr

    *made the cardview height to wrap content

    *changed linearlayout textview height to wrap content

    *set layoutmanager as a linear vertical layout manager

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

    How to embed a Flutter application in a Website using DartPad

    Posted: 01 Apr 2020 08:16 AM PDT

    View/Button isn't clickable

    Posted: 01 Apr 2020 11:32 AM PDT

    So, im making an for the purpose of calculating numbers in a game while the user plays the game.

    For that i've made a floating button that draws over all apps.

    The issue im facing is that the button isn't clickable, and when i set a listener it crashes.

    Heres the code.. thanks for help.

    MainActivity.kt

    package com.example.rokcalkot import android.content.Intent import android.app.Activity import android.os.Build import android.provider.Settings import android.view.View import android.content.pm.PackageManager import android.os.Bundle import android.util.Log import android.widget.Button import android.widget.Toast import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import android.net.Uri import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import kotlinx.android.synthetic.main.onscreen.* import android.graphics.Canvas import android.graphics.Color import android.graphics.Bitmap class MainActivity : AppCompatActivity() { val requestCode = 201 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) //-------------------------- LAUNCH BUTTON BTN --------------------------- val btnL = findViewById<Button>(R.id.btnShow) val btnS= findViewById<Button>(R.id.btnService) /*btnS.setOnClickListener{ Toast.makeText(this@MainActivity, "CLICKBLE", Toast.LENGTH_LONG).show() }*/ //btnShow?.setOnClickListener { Toast.makeText(this@MainActivity, "Bannaa", Toast.LENGTH_LONG).show() } btnL.setOnClickListener { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) { val intent = Intent( Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:$packageName") ) startActivityForResult(intent, requestCode) //startActivityForResult(intent2,requestCode1) } else { startService(Intent(this, MyFloatingWindowService::class.java)) finish() } //Toast.makeText(this@MainActivity, "Bannaa", Toast.LENGTH_LONG).show() } fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (resultCode == Activity.RESULT_OK) { startService(Intent(this, MyFloatingWindowService::class.java)) finish() } } //--------------- TAKE SCREENSHOT ---------------- fun takeScreenshotOfView(view: View, height: Int, width: Int): Bitmap { val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) val canvas = Canvas(bitmap) val bgDrawable = view.background if (bgDrawable != null) { bgDrawable.draw(canvas) } else { canvas.drawColor(Color.WHITE) } view.draw(canvas) return bitmap } } } 

    Activity_Main.xml

    <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:theme="@style/AppTheme" tools:context=".MainActivity"> <Button android:id="@+id/btnShow" android:layout_width="95dp" android:layout_height="96dp" android:text="Start Rok Cal" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/textView" android:layout_width="141dp" android:layout_height="45dp" android:text="Welcome to Rok Cal" app:layout_constraintBottom_toTopOf="@+id/btnShow" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> 

    MyFloatingWindowService.kt

    package com.example.rokcalkot import android.annotation.SuppressLint import android.app.Service import android.content.Context import android.content.Intent import android.graphics.PixelFormat import android.os.Build import android.os.IBinder import android.view.* import android.widget.Toast import kotlin.math.roundToInt class MyFloatingWindowService : Service() { var LAYOUT_FLAG: Int = 0 lateinit var floatingView: View lateinit var floatingViewMain: View lateinit var manager: WindowManager lateinit var params: WindowManager.LayoutParams override fun onBind(intent: Intent?): IBinder? { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { LAYOUT_FLAG = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY } else { WindowManager.LayoutParams.TYPE_PHONE } val params = WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, LAYOUT_FLAG, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT ) this.params = params //Specify the view position params.gravity = Gravity.TOP or Gravity.CENTER //Initially view will be added to top-left corner params.x = 0 params.y = 0 manager = getSystemService(Context.WINDOW_SERVICE) as WindowManager floatingView = LayoutInflater.from(this).inflate(R.layout.onscreen, null) floatingViewMain = LayoutInflater.from(this).inflate(R.layout.activity_main, null) manager.addView(floatingView, params) floatingView.findViewById<View>(R.id.btnService)?.setOnTouchListener(object : View.OnTouchListener { var initialX: Int? = null var initialY: Int? = null var initialTouchX: Float? = null var initialTouchY: Float? = null @SuppressLint("ClickableViewAccessibility") override fun onTouch(view: View?, motionEvent: MotionEvent?): Boolean { //Toast.makeText(this@MyFloatingWindowService, "Clickble", Toast.LENGTH_SHORT).show() when (motionEvent!!.action) { MotionEvent.ACTION_DOWN -> { //remember the initial position. initialX = params.x initialY = params.y //get the touch location //Toast.makeText(this@MyFloatingWindowService, "ACTION DOWN", Toast.LENGTH_SHORT).show() initialTouchX = motionEvent!!.getRawX() initialTouchY = motionEvent!!.getRawY() return true } MotionEvent.ACTION_UP -> { //Toast.makeText(this@MyFloatingWindowService, "ACTION UP", Toast.LENGTH_SHORT).show() val Xdiff = (motionEvent.getRawX() - initialTouchX!!) val Ydiff = (motionEvent.getRawY() - initialTouchY!!) return true } MotionEvent.ACTION_MOVE -> { //Calculate the X and Y coordinates of the view. params.x = initialX!!.plus((motionEvent.getRawX() - initialTouchX!!)).roundToInt() params.y = initialY!!.plus((motionEvent.getRawY() - initialTouchY!!).roundToInt()) manager.updateViewLayout(floatingView, params) return true } } return false } }) return START_NOT_STICKY } fun CHECK() { Toast.makeText(this@MyFloatingWindowService, "Clickble", Toast.LENGTH_LONG).show() } override fun onDestroy() { super.onDestroy() manager.removeView(floatingView) } } 

    onscreen.xml --> the xml that the service interacts with which draws over all apps.

    <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:theme="@style/AppTheme" tools:context=".MainActivity" android:launchMode="singleTask"> <Button android:id="@+id/btnService" android:layout_width="51dp" android:layout_height="62dp" android:clickable="true" android:text="Start Service" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.522" /> </androidx.constraintlayout.widget.ConstraintLayout> 
    submitted by /u/XploRs
    [link] [comments]

    Learn the basics of Kotlin with examples for beginner - p3

    Posted: 01 Apr 2020 11:27 AM PDT

    Social network about spreading diseases

    Posted: 01 Apr 2020 10:26 AM PDT

    Since we have the COVID-19 and I have plenty of time, I thought of using the spare time for something good and maybe giving a shot an Android application, that would help analyze and track diseases through a network. The network would be basically tracking who meets with whom, with the possibility of either GPS, NFC or manual input. The point of that would be to inform others who met with an infected person to be notified and set a priority equal to meeting with the infected person. Secondary functionality would be analyzing sickness by its symptoms and possible human discussion with a doctor. Do you think it's possible to create this kind of application without starting publicity? I appreciate any opinions or advices about the subject.

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

    Getting up to speed after a break from Android Dev

    Posted: 01 Apr 2020 10:25 AM PDT

    Hi devs!

    I cut my teeth and comfortably had a role as an Android Developer at a previous job, but I left mid/late 2018 and haven't developed for Android since. I miss it and it's a role I'd like to have again. What did I miss? And am I stupid to think I'll be hired after this break from it?

    Where I left off was: Pull out drawers were less cool and bottom bars were the new thing and Android phones could have notches too. I was writing apps almost entirely in Kotlin by that point (which is awesome). I was around for the big shift to Architecture Components, I spent a lot of time looking at the blueprints and MVVM, MVP, Clean Architecture, Rx and livedata and wondering what architecture to use.

    What have I missed since then? I see a lot about Jetpack and I'm sure lots of the architecture patterns and components have changed. What else should I refresh or learn?

    I welcome any generally well informed info on how you're building your apps too and any other tips.

    Thanks!

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

    How to build a symptoms checking app?

    Posted: 01 Apr 2020 09:39 AM PDT

    I want to build a symptoms checking apps so everyone can check there symptoms and come out in lockdown for medical care only if necessary please guide me how can I build app like it is very much needed in India and also ministry of health have put on there website.

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

    need guidance

    Posted: 01 Apr 2020 09:19 AM PDT

    hello, i'm making a project called "outfit of the day" with a partner, he is on desktop, i´m on android. I had neder developed an application to android and I'm a little stuck we need to build a catalogue with photos of clothes that people can save in app, and a menu called closet where people can view the items they save, can someone give me a guidance in how to make a catalogue?

    thanks in advance

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

    Get the latest #androiddev articles from more than 100 blogs on Telegram channel

    Posted: 01 Apr 2020 09:09 AM PDT

    Indie Android developers can see their net revenue directly in the application (beta version)

    Posted: 01 Apr 2020 07:46 AM PDT

    Learn to fetch data from a text file in Flutter

    Posted: 01 Apr 2020 07:17 AM PDT

    Library for managing files and storage

    Posted: 01 Apr 2020 07:12 AM PDT

    Scoped Storage? Back in the day, all we needed was just the right path string and it used to work. All beautiful.

    Unfortunate changes related to Storage in Android 10 and then going a little easy on devs in Android 11 sounds foolish to me. It's all messed up.

    All I want to do is read and save files on "/sdcard/MyApporSomething/". Do you guys have any library to easily work with files on all android versions or do I need to get my hands dirty? Thanks :)

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

    Can BOM (bill of materials) be used in Gradle build script classpath dependencies?

    Posted: 01 Apr 2020 02:37 AM PDT

    Asking because Firebase BOM includes version for Gradle plugin com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta03, which is added to classpath of top-level build script. BOM usage example only tells to add BOM to module's build.gradle via implementation platform.

    So the question is, can the version from BOM be propagated to buildscript classpath? I tried adding BOM line to classpath to no avail.

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

    Kotlin Coroutines - So that you async

    Posted: 01 Apr 2020 06:16 AM PDT

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel