r/KotlinAndroid • • Jun 15 '21

FULLSTACK FLUTTER SIGNAL CHAT CLONE using SOCKET.IO

Thumbnail
youtube.com
3 Upvotes

r/KotlinAndroid • • Aug 02 '22

Anyone currently working in mobile app development and have a few minutes?

1 Upvotes

Hi all! I'm Lauren, I work for raywenderlich.com, and we have a survey going right now that we hope will help all developers working right now in the mobile app space. The results of this survey will help other developers better know their worth, no matter where in the world they are and we want to share that information for free with the community 😁

We need about 8 minutes of your time to help other mobile app developers by answering the survey here.

After answering questions about yourself, your professional experience, and your work with no personally identifying information, we'll compile all the information and release it for free to the community after September 15th, 2022. Still have questions on how we hope this will benefit users? Check out our article here all about it (or ask questions here).

In case you aren't a match for our survey but still want to help, please feel free to share the link with your network as well!


r/KotlinAndroid • • Jan 18 '22

New to Kotlin

0 Upvotes

Is there anyone willing to teach me how to use kotlin using the xml files i have made?


r/KotlinAndroid • • Dec 09 '20

Object movement when tilting phone.

0 Upvotes

I am very new with kotlin and Android Studio so can you help a bit.

My goal is to make an app that has a ball and textview on it. When tilting the phone, coordinates appear in textview. That I have managed. I need to have the ball on customview which is called in this case MyView. The ball should move according to the coordinates in textview.

I have no idea even how start this. All I know that I need to make the values match the movement of the ball and that I need to make some calculations that the ball doesn't go off screen or even off myview area. So can you give me some guidance?

All the ball does at the moment is moving where the user clicks.

My code so far:

import android.annotation.SuppressLint
import android.content.Context
import android.hardware.Sensor
import android.hardware.SensorEvent
import android.hardware.SensorEventListener
import android.hardware.SensorManager
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity(), SensorEventListener {
    private lateinit var sensorManager: SensorManager
    private var mLight: Sensor? = null

    @SuppressLint("ClickableViewAccessibility")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
 
        setContentView(R.layout.activity_main)

        sensorManager = getSystemService(Context.SENSOR_SERVICE) as SensorManager
        mLight = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER)

             myView.setOnTouchListener { view, e ->
                 myView.setXY(e.x, e.y)
                 true
             }
    }

    override fun onAccuracyChanged(p0: Sensor?, p1: Int) {
        // TODO("Not yet implemented")

    }

    override fun onSensorChanged(p0: SensorEvent) {
    textView.text = p0.values[0].toString() + ", " + p0.values[1]+ ", " + p0.values[2] + ", "

    }

    override fun onPause() {
        super.onPause()
        sensorManager.unregisterListener(this)

    }

    override fun onResume() {
        super.onResume()
        mLight?.also { light ->
            sensorManager.registerListener(this, light, SensorManager.SENSOR_DELAY_NORMAL)

        }
    }
}

and MyView

import android.R.attr
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View


class MyView(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
    var x1=0f
    var y1=0f
    override fun onDraw(canvas: Canvas?) {
        //super.onDraw(canvas)
        val paint = Paint()
        paint.color = Color.MAGENTA

        canvas?.drawOval(x1,y1,x1+100f,y1+100f, paint)
        paint.style = Paint.Style.STROKE
        paint.color = Color.BLACK
        paint.strokeWidth = 5f

        canvas?.drawOval(x1,y1,x1+100f,y1+100f, paint)
    }

    fun setXY(new_x: Float, new_y: Float) {
        x1 = new_x
        y1= new_y
        invalidate()
    }
}

r/KotlinAndroid • • Aug 04 '21

Why using Kotlin Coroutines?

Thumbnail
kt.academy
0 Upvotes

r/KotlinAndroid • • Apr 25 '18

Kotlin’s Nothing: Its Usefulness in Generics

Thumbnail
blog.kotlin-academy.com
0 Upvotes

r/KotlinAndroid • • Feb 02 '20

I can't get a data class to return correct values. Please Help!

0 Upvotes

I'm working on my first android application and I'm banging my head against the wall. I'm trying to get information from Google firestore and store it in a way that I can use it. I'm currently trying to store it in a data class. I can get the information with no problem. But when I try to return the Data class to another method, it only contains the default values and not the values that are being returned.

I've linked some of my code ( the things I feel are relevant). I'm using Anko for AsyncTasks as well. I've combed the Kotlin documentation and Stack Overflow and can't seem to find anything that address my problem. I'd really appreciate it if you guys could take a look at it and see if you see anything I don't know or may have missed.

Thank you!


r/KotlinAndroid • • Jul 23 '18

Effective Java in Kotlin, obsolete items thanks to Kotlin (items 3, 4, 16, 40, 61 from 3rd edition)

Thumbnail
blog.kotlin-academy.com
0 Upvotes

r/KotlinAndroid • • Feb 07 '19

How would you debug constructor of a data class

0 Upvotes

How would I put a break point in the constructor of a data class declared as follows:

data class Person(val name: String, val lastname: String)

This would be inside android Studio.

Thanks.


r/KotlinAndroid • • Apr 15 '20

Animations in Jetpack Compose using Transition

Thumbnail
proandroiddev.com
0 Upvotes

r/KotlinAndroid • • Dec 16 '20

Which programming language to choose from Java and Kotlin for Android Application Development?

Thumbnail
kodytechnolab.com
3 Upvotes

r/KotlinAndroid • • Apr 16 '21

Don't waste your time handling strings XML files manually on Android!

Thumbnail
loca.link
0 Upvotes

r/KotlinAndroid • • Mar 06 '24

Bluetooth connection error

Post image
3 Upvotes

r/KotlinAndroid • • Aug 25 '19

Build a About Screen UI in Android Applications with Kotlin - Coding Shiksha - Coding Shiksha

Thumbnail
codingshiksha.com
1 Upvotes

r/KotlinAndroid • • Apr 24 '19

Problem with a RecyclerView and ItemTouchHelper

1 Upvotes

r/KotlinAndroid • • Apr 02 '24

Good evening, a question, how can I refresh my application every 8 minutes, is that I am managing a token that is changed every 8 minutes.

2 Upvotes

r/KotlinAndroid • • Mar 06 '24

Android App Error Bluetooth

Post image
0 Upvotes

r/KotlinAndroid • • Mar 01 '22

Convertion of String to Double or Int in Kotlin and android studio.

2 Upvotes

Hello , I hope you are all fine , i am new to kotlin and android studio. I am trying to to convert the string to interger or to double but for some reason android studio(4.1.2) does not recognize the .toDouble() or .toInt().

Here is a code snippet

fun computeTipAndTotal() {
val stringInTextField = binding.etBaseAmount.text.toString() val cost= stringInTextField.toInt()
}

the .toInt() iturned red and is not recognized by the IDE.

Any leads will be helpful.


r/KotlinAndroid • • Dec 12 '18

Why can inheritance be dangerous? The Perils of Inheritance

Thumbnail
blog.kotlin-academy.com
2 Upvotes

r/KotlinAndroid • • Jul 23 '20

Why People Do Not Adopt Kotlin for Android Development?

2 Upvotes

Hey crew!

I believe most in this subreddit is Kotlin fans. But I wonder do you ever heart about obstacles or even blockers to use Kotlin for Android development?

I'm interested in the evolution of the programming environment and started research about Java vs Kotlin for Android. So, happy to hear real-life stories from your practice.

Thanks in advance)


r/KotlinAndroid • • Nov 17 '18

FreeSoftware License Kotlin Android App

0 Upvotes

Hi, NokulSoft is a StartUp. NokulSoft, make open source and freesoftware license mobile and web app.
NokulSoft: http://nokulsoft.com
NokulSoft GitHub Repo: https://github.com/ilteriskesk/NokulSoft


r/KotlinAndroid • • Feb 24 '19

How to make a wallet in android app through Kotlin

0 Upvotes

I am doing a startup of an app so, I want to know how we can integrate wallet in android app


r/KotlinAndroid • • Jun 11 '20

UI design to Android apps!

Thumbnail
youtu.be
3 Upvotes

r/KotlinAndroid • • Nov 10 '21

Kotlin vs Groovy: A Comparison Guide for Android App Development in 2021

Thumbnail
websoptimization.com
3 Upvotes

r/KotlinAndroid • • Feb 29 '20

Create a Gradient Button

Thumbnail
youtu.be
3 Upvotes