Giter Site home page Giter Site logo

hussien89aa / kotlinudemy Goto Github PK

View Code? Open in Web Editor NEW
1.8K 247.0 5.1K 2.73 MB

Learn how to make online games, and apps for Android O, like Pokémon , twitter,Tic Tac Toe, and notepad using Kotlin

Home Page: https://www.udemy.com/the-complete-kotlin-developer-course/?couponCode=UDMEYGITHUB

License: MIT License

Kotlin 87.93% Java 9.47% PHP 2.60%
kotlin kotlin-android

kotlinudemy's Introduction

The complete Android Kotlin Developer course

In this course you will learn how to make 17 online games, and apps for Android, using Kotlin. check the videos Tutorial here.

Bellow, list of open source Apps that we build in tutorial

Course Description

This course for anyone who want to be Kotlin programmer from scratch, We will start by discus all programming fundamentals that you need to start programming Kotlin. We will start first by install the development environment then you will run your first Kotlin app, and understand how program flow works in Kotlin. Then we will talk about variables and Math operation and proirites. Then we will take about logic and making decision, then we will talk about loops. Then we will talk about how to work with files.Then we will talk about functions and OOP concept that you need to use when you program apps with Kotlin, then we will talk about collections and which type collection you have to use for better performance depend on your app. then we will talk about multi-processing and how you could run multi-process in same time. Then you will learn how to build apps and game in Android like pockemon and tic tac toy and work with restful web services and JSON by build apps like get sunshine time. Also you will learn how to work with sqlite database to add, delete and update records, also you will learn how to use Firebase for online gaming and build social media app like twitter, and Learn how to build apps with sensors like run music when light is on and Nimbuzz vibrate when phone is shake, and more

main

kotlinudemy's People

Contributors

hussien89aa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kotlinudemy's Issues

I want the user to write like this picture

Capture (2)
How do I write a programming syntax for me to (readline) kotlin in arithmetic operations For example: I want to collect but by writing (readline)
I want to write the arithmetic formula like this:- (1 + 5= or 3-7=) I want to write a code that gives the user the freedom to calculate by writing the arithmetic operations in the Kotlin language

السلام عليكم محاولة حذف من المفضلة

السلام عليكم سويت تطبيق عبارة عن اذكار طبعا فيه إمكانية إضافة للمفضلة لكن عند محاولة الحذف من المفضلة ماقدرت احذف أي حاولت المطلوب كيف اضغط ضغط مطول على العنوان في المفضلة ويتم الحذف او يعطيني رسالة للتاكيد

هذا الكود لكن بدون جدوى

// بداية الحذف

       listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
           @Override
           public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {

               int ID = listView.getCheckedItemPosition();
               Integer result =db_fav.Delete(listIndex.get(ID));

               if (result >0){
                   Toast.makeText(Favorite.this,"تم الحذف",Toast.LENGTH_SHORT).show();
                   arrayAdapter.remove(listIndex.get(ID));
                   db_fav.Delete(listIndex.get(ID));
               }else{
                   Toast.makeText(Favorite.this,"لم يتم الحذف ",Toast.LENGTH_SHORT).show();
               }

               // int PageNum = 0;
               //if (List_Type.equals("Favorite")) {
                //   PageNum = List_Favorite.get(position).getPage_id();
                //   arrayAdapter.remove(listIndex.get(ID));
                  // db_fav.Delete(listIndex.get(ID));
                 //  arrayAdapter.notifyDataSetChanged();
             //      Toast.makeText(Favorite.this, "تم الحذف", Toast.LENGTH_SHORT).show();

             //  }
               return false;
           }
       });

       // 

نهاية الحذف

واذا تبي اعرف لك التطبيق كامل قلي

E/memtrack: Couldn't load memtrack module

I have tried with ADV Pixel 2 API 27 and real device xiaomi 8 se which has 6 GB ram

here is manifest.xml

  <?xml version="1.0" encoding="utf-8"?>
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                      package="com.example.myapplication">

         <application
                android:allowBackup="true"
               android:icon="@mipmap/ic_launcher"
               android:label="@string/app_name"
              android:roundIcon="@mipmap/ic_launcher_round"
              android:supportsRtl="true"
              android:theme="@style/AppTheme">
            <activity android:name=".MainActivity">
                  <intent-filter>
                       <action android:name="android.intent.action.MAIN" />

                      <category android:name="android.intent.category.LAUNCHER" />
               </intent-filter>
         </activity>



    </application>

  </manifest>

update: update the code to match new features

Update the code for all the projects in order to make them compatible with the new version on Android Studio and Kotlin 1.6.20. This is because the code the way it is will cause the app to crash or not do anything at all. This was something I struggled with when following a tutorial that was dated before the new releases.

Note
Also, if you cannot do it yourself, then find a maintainer to maintain this repo and keep it up-to-date for new students to easily follow and use the newly accepted features without having to search the web for the solution to why their code isn't running in the first place.

Error - Firebase authentication

screen shot 2018-05-25 at 3 49 53 pm

gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.android.firebase"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1' // error in this line
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

محاولة وفيها مشكلة

السلام عليكم استاذ حسين

حاولت اقول بتطبيق ما ذكر من ايجاد العمر باليوم والشهر والسنة هذه المشكلة

import java.util.*
fun main(args: Array){

// input
println("Enter Your birthDay : ")
var DayofBirth: Int = readLine()!!.toInt()

println("Enter Your birthMonth : ")
var MonofBirth: Int = readLine()!!.toInt()

println("Enter Your birthYear : ")
var yearofBirth: Int = readLine()!!.toInt()



// process
var Today   =Calendar.getInstance().get(Calendar.DAY_OF_WEEK_IN_MONTH)
var Tomonth =Calendar.getInstance().get(Calendar.MONTH)
var Toyear  =Calendar.getInstance().get(Calendar.YEAR)
var Age            :Int ?=null
var TheDay      :Int ?=null
var Themonth  :Int ?=null
var Theyear     :Int ?=null

if (Today < DayofBirth) {
    Today += 28
    Tomonth=-1
}
else
{
    TheDay= Today - DayofBirth
    println("age of days : $TheDay")
}

if (Tomonth < MonofBirth)
{
    Tomonth = +12
    Toyear = -1
}
else {

    Themonth = Tomonth - MonofBirth
    println("age of Month  $Themonth " )
     }

 Theyear = Toyear - yearofBirth


    // output
println("Your Age Day&Month&Year Is: $TheDay Days  $Themonth Months  $Theyear  Years")

}

السلام غليكم

يا أستاذ حسين تظهر لي هذه المشكلة
org/jetbrains/kotlin/asJava/KtLightClassForExplicitDeclaration

var downloadurl = uploadtask.downloadUrl لا يوجد

package com.example.dell.howtocreattwitter

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.provider.MediaStore
import android.view.*
import android.widget.Adapter
import android.widget.BaseAdapter
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.storage.FileDownloadTask
import com.google.firebase.storage.FirebaseStorage
import com.google.firebase.storage.StreamDownloadTask
import com.google.firebase.storage.UploadTask
import kotlinx.android.synthetic.main.activity_login.*
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.ticket.view.*
import kotlinx.android.synthetic.main.tweets_tickets.view.*
import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat
import java.util.*
import java.util.zip.Inflater

class MainActivity : AppCompatActivity() {
//get storage instance
var storage = FirebaseStorage.getInstance()
// get storage ref
var storageRef=storage.getReferenceFromUrl("gs://howtocreattwitter.appspot.com")
var listoftweets = ArrayList()
var adapter: mytweetAdapter? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
listoftweets.add(holdAdapterObjects("0", "hey", "url", "add"))
listoftweets.add(holdAdapterObjects("1", "hey", "url", "moha"))
listoftweets.add(holdAdapterObjects("1", "hey", "url", "moha"))
listoftweets.add(holdAdapterObjects("1", "hey", "url", "moha"))
adapter = mytweetAdapter(this, listoftweets)
lvtweets.adapter = adapter

}

// creat on option menu
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
    menuInflater.inflate(R.menu.signout, menu)
    return super.onCreateOptionsMenu(menu)

}

override fun onOptionsItemSelected(item: MenuItem?): Boolean {
    when (item!!.itemId) {
        R.id.sign -> {
            FirebaseAuth.getInstance().signOut()
            var intent = Intent(this, login::class.java)
            startActivity(intent)
        }
    }
    return super.onOptionsItemSelected(item)

}

//creaat adapter
inner class mytweetAdapter : BaseAdapter {
    var context: Context? = null
    var arraylist = ArrayList<holdAdapterObjects>()

    constructor(context: Context, arrayList: ArrayList<holdAdapterObjects>) {
        this.context = context
        this.arraylist = arrayList
    }

    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
        var pos = arraylist[position]
        if (pos.tweetPersonUid.equals("add")) {
            //load ticket
            var view = LayoutInflater.from(context).inflate(R.layout.ticket, null, false)
            view.attach.setOnClickListener(View.OnClickListener {

            })
            return view
        } else {
            // load tweets_tickts
            var view = LayoutInflater.from(context).inflate(R.layout.tweets_tickets, null, false)
            return view
        }


    }

    override fun getItem(position: Int): Any {
        return arraylist[position]
    }

    override fun getItemId(position: Int): Long {
        return position.toLong()
    }

    override fun getCount(): Int {
        return arraylist.size
    }

}

var pickimagecode = 123
fun loadimage() {
    val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
    intent.type = "image/*"
    startActivityForResult(intent, pickimagecode)
}

@SuppressLint("Recycle")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == pickimagecode && data != null) {
        // another metod to pick image from gallery
        val contenturi = data.data
        val bitmap = MediaStore.Images.Media.getBitmap(this.contentResolver, contenturi)
        uploadimage(bitmap)

        // third method to pick image from gallary
        // imageView.setImageURI(data.data)

    }
    /*{
    method to pick image from gallery
             val selectedimage   = data.data
			val imagepath = arrayOf(MediaStore.Images.Media.DATA)
			val crusor = contentResolver.query(selectedimage,imagepath,null,null,null)
			crusor!!.moveToFirst()
			val index = crusor.getColumnIndex(imagepath[0])
			val picpath = crusor.getString(index)
			imageView.setImageBitmap(BitmapFactory.decodeFile(picpath))
			 }
			*/


}

var Bundle = intent.extras
var email: String? = null

fun uploadimage(bitmap: Bitmap) {

    // to creat unique name by day and hour
    //creat data format what is like
    var dataFormat = SimpleDateFormat("ddMMyyHHmmss")
    var date = Date()
    // thats what the name appear
    email = Bundle!!.getString("email")
    var imagepath = stringsplit(email!!) + dataFormat.format(date) + ".jpg"
    var imageref = storageRef.child("images" + imagepath)

    //compress the bitmap
    //......
    val bios = ByteArrayOutputStream()
    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bios)
    val data = bios.toByteArray()
    //......
    // upload image to firebase
    val uploadtask = imageref.putBytes(data)

    uploadtask.addOnFailureListener {
        Toast.makeText(this, " add to fire base failed", Toast.LENGTH_LONG).show()
    }.addOnSuccessListener{ taskSnapshot ->
        Toast.makeText(this, " add to fire base success", Toast.LENGTH_LONG).show()
        
        var downloadurl = imageref.downloadUrl.toString()

    }




}
fun stringsplit(email: String): String {
    var ss = email.split("@")
    var name = ss[0]
    return (name)
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.