{"id":17868161,"url":"https://github.com/futurechallenger/kotlinandroid","last_synced_at":"2026-04-15T12:35:28.021Z","repository":{"id":145606321,"uuid":"83966274","full_name":"futurechallenger/kotlinAndroid","owner":"futurechallenger","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-28T12:05:54.000Z","size":156,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T22:29:37.483Z","etag":null,"topics":["android","kotlin"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/futurechallenger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-05T11:53:14.000Z","updated_at":"2017-05-28T12:08:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"55295d28-723c-4de5-9d28-c2fe088e863a","html_url":"https://github.com/futurechallenger/kotlinAndroid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/futurechallenger/kotlinAndroid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurechallenger%2FkotlinAndroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurechallenger%2FkotlinAndroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurechallenger%2FkotlinAndroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurechallenger%2FkotlinAndroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/futurechallenger","download_url":"https://codeload.github.com/futurechallenger/kotlinAndroid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurechallenger%2FkotlinAndroid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T11:29:19.690Z","status":"ssl_error","status_checked_at":"2026-04-15T11:29:19.171Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","kotlin"],"created_at":"2024-10-28T09:57:03.087Z","updated_at":"2026-04-15T12:35:27.978Z","avatar_url":"https://github.com/futurechallenger.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Kotlin Android\nDemos for building android apps with kotlin.\n\n## ListView\nA list view with `BaseAdapter` as its adapter. And handle list item click handler.\n```kotlin\nclass CelebrityAdapter(var celebrityList: Array\u003cCelebrity\u003e, val context: Context) : BaseAdapter() {\n    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {\n      var view: View? = null\n      val viewHolder: ListRowHolder\n      if (convertView == null) {\n        view = LayoutInflater.from(context).inflate(R.layout.list_item, parent!!, false) as View\n        viewHolder = ListRowHolder(view)\n        view.tag = viewHolder\n      } else {\n        view = convertView\n        viewHolder = view.tag as ListRowHolder\n      }\n\n      viewHolder.titleTextView.text = celebrityList.get(position).name\n      viewHolder.subtitleTextView.text = celebrityList.get(position).twitter\n\n      return view\n    }\n\n    override fun getItem(position: Int): Any {\n      return celebrityList.get(position)\n    }\n\n    override fun getItemId(position: Int): Long {\n      return position.toLong()\n    }\n\n    override fun getCount(): Int {\n      return celebrityList.size\n    }\n  }\n\n  private class ListRowHolder(row: View?) {\n    public val titleTextView: TextView\n    public val subtitleTextView: TextView\n\n    init {\n      this.titleTextView = row?.findViewById(R.id.textView) as TextView\n      this.subtitleTextView = row?.findViewById(R.id.subtitleTextView) as TextView\n    }\n  }\n}\n```\nCustomized `BaseAdapter` `CelebrityAdapter`. Optimize the list view performance with a *Row Holder* `ListRowHolder`.\n\n## Handler\n```kotlin\n  private var _handler: Handler = object : Handler() {\n    override fun handleMessage(msg: Message) {\n      if(msg.what == 0x123) {\n        // do something\n      }\n    }\n  }\n```\nEvery 200 ms, send a message to handler:\n```kotlin\n  override fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_handler)\n\n    Timer().schedule(object : TimerTask() {\n      override fun run() {\n        _handler.sendEmptyMessage(0x123)\n      }\n    }, 0, 200)\n  }\n```\n\n## OK Http \n\nYou can do http request with `okHttp` library. It also brings *Connection Pool* and *cache*, *Gzip*, etc. It helps improve http requests. You can do sync and async http requests with okHttp.\n\n### Sync request\n```kotlin\nclass SyncActivity : AppCompatActivity(), View.OnClickListener {\n  private val TAG = SyncActivity::class.java.simpleName\n\n  private var _startButton: Button? = null\n  private var _textView: TextView? = null\n\n  override fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_sync)\n\n    _startButton = findViewById(R.id.startButton) as Button\n    _textView = findViewById(R.id.textView) as TextView\n    _startButton!!.setOnClickListener(this)\n  }\n\n  override fun onClick(v: View?) {\n    var okHttpTask = OKHttpTask(_textView!!)\n    okHttpTask.execute(\"https://api.github.com/\")\n  }\n\n  open class OKHttpTask(textView: TextView) : AsyncTask\u003cString, Void, String\u003e() {\n    var client = OkHttpClient()\n    private var httpTextView: TextView? = textView\n\n    override fun doInBackground(vararg params: String?): String {\n      var builder = Request.Builder()\n      builder.url(params[0])\n      var request = builder.build()\n\n      try {\n        var response = client.newCall(request).execute()\n        return response.body().string()\n      } catch (e: Exception) {\n        e.printStackTrace()\n      }\n\n      return \"\"\n    }\n\n    override fun onPostExecute(result: String?) {\n      super.onPostExecute(result)\n      httpTextView!!.text = result\n    }\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturechallenger%2Fkotlinandroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuturechallenger%2Fkotlinandroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturechallenger%2Fkotlinandroid/lists"}