Questions tagged [anko]

Anko is a deprecated JetBrains library for Android application development

Anko is JetBrains library for Android application development (wrapper for Android SDK for Java), written in .

It was deprecated on the 1st of December 2019 and its use is no longer recommended.

258 questions
0
votes
1 answer

How to set bottom margin to FAB in Anko DSL layout?

I use Anko DSL layout in my kotlin activity. I can not set bottom margin to FAB. Right margin work. In my activity override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) (application as…
eurosecom
  • 2,932
  • 4
  • 24
  • 38
0
votes
1 answer

How to set FloatingActionButton border width with Anko

I've just switched from Java to Kotlin and I'm using Anko for building layouts. and this is my layout : relativeLayout { floatingActionButton { imageSource = R.drawable.kotlin_is_amazing }.lparams { width = wrapContent …
Mahdi Nouri
  • 1,391
  • 14
  • 29
0
votes
1 answer

Why can't Anko ignore the passed value of _id when _id is INTEGER + PRIMARY_KEY+ AUTOINCREMENT?

I have designed the _id field is INTEGER + PRIMARY_KEY+ AUTOINCREMENT, I use the code SettingManage().addSetting(MSetting(10L,"My Settings",2000L,"This is description!")) to insert a record to the table. I think Anko will ignore the passed value 10…
HelloCW
  • 843
  • 22
  • 125
  • 310
0
votes
1 answer

Receiver Type Mismatch with Anko Layouts

I am trying to create layouts with Anko DSL in my support v4 Fragment but the IDE shows receiver type mismatch. DSL works ok from the v7 AppCompatActivity. In trying to get this to work I have updated to Android Studio 3.0. I have also updated the…
Himanshu
  • 2,384
  • 2
  • 24
  • 42
0
votes
0 answers

How to design a SQLite table using Anko in Kotin?

I design a very simple table using Anko in Kotlin, there is a primary key named _id in the table and I hope the _id is passed value automatically by SQLite system. I have read some sample code,but I don't know which one is correct, Method 1, Method…
HelloCW
  • 843
  • 22
  • 125
  • 310
0
votes
1 answer

Why is createView never called?

My ultimate goal is to be able move my content widgets into a custom view and instantiate that view in an Anko layout in my MainView. I thought I had this working at one point, but I can't reproduce it. When I run with the following code, the…
nPn
  • 16,254
  • 9
  • 35
  • 58
0
votes
0 answers

Imports Not Being Used in Android Studio

For some reason non-Android imports aren't working in this Kotlin class that I have. They work in other classes with onCreate methods, but not this adapter class. Is the issue that I don't have an onCreate method in this class? I'm trying to use…
StealthDroid
  • 365
  • 1
  • 4
  • 14
0
votes
1 answer

Can't initialize object parser for model.Products, no acceptable constructors found

I follow Stress-free SQLite with Anko to learn Kotlin, so I created the class data class Products(val id: Long, val name: String, val description: String, val price: Long, val image: String, val status: String, val type: String ) { companion…
Toai Luong
  • 101
  • 4
  • 11
0
votes
2 answers

Using Anko SQLLite, what is the best way to check if a database exists?

I'm working on an Android app using Kotlin and as part of the startup process, I would like to determine whether or not a SQL Lite database already exists (meaning the user is not a new user) I've so far been unable to determine what is the best way…
Senkwe
  • 2,256
  • 3
  • 24
  • 33
0
votes
2 answers

How to set maxLength in Anko

I have been trying to set maxLength for editText in Anko but I am unable to find the right function. editText() { id = R.id.et2 hint = "age" inputType = android.text.InputType.TYPE_CLASS_NUMBER …
jithendra sai
  • 73
  • 1
  • 11
0
votes
1 answer

How replace webView by custom webView?

I has my activity that contain only one webView. Activity write on Kotlin: class MyActivity : AppCompatActivity() { @SuppressLint("NewApi") override fun onCreate(savedInstanceState: Bundle?) { // some code here …
Alex
  • 1,857
  • 4
  • 17
  • 34
0
votes
1 answer

Android Studio reports "Could not identify launch activity: Default Activity not found" when building Kotlin projects

I'm trying to build an Android app using Kotlin and Anko. When I select "Run" in Android Studio I get the error: Could not identify launch activity: Default Activity not found Error while Launching activity and the app does not start. I get this…
Laurence Gonsalves
  • 137,896
  • 35
  • 246
  • 299
0
votes
1 answer

Parsing JSON using Klaxon with Anko's doAsync fails to execute

I'm trying to parse an url containing JSON whenever I press a button : button.setOnClickListener { doAsync{ val result = URL("http://date.jsontest.com/").readText() val parser: Parser = Parser() val stringBuilder: StringBuilder =…
rotten_flesh
  • 69
  • 2
  • 13
0
votes
0 answers

Does anko logger library log message in debug build or signed build also

I am trying to use anko commons library for logging debug message on logcat. I want to display logging message in debug build not in signed build. I know I can remove logging in signed builds using Proguard also. I want to know if anko library…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
0
votes
1 answer

Adding a swipe listener to textView in Anko

I'm looking to add swipe detection to a textView. I'm using Anko with Kotlin, and when it comes to setting up the textView, I'm able to specify an onClick event, but when I try to add an onTouch or any other gesture, it seems to fail for me (the…
Christopher Coyle
  • 103
  • 1
  • 2
  • 9