Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added snapchat clone #2215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions android_apps/SnapChatClone/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
46 changes: 46 additions & 0 deletions android_apps/SnapChatClone/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
</img><h1 align="center"> <img height=50 width=50 src="https://support-tools.storage.googleapis.com/Team-Snapchat-Snapcode-981935546.png"> SnapChat Clone</h1>

<br>
<p>
<h2>Simple Snapchat like app</h2>
</p>
<br>

### :zap: Features:
- [x] Create User account
- [x] Send snaps(Choose from Device storage)
- [x] Send small message along with snap
- [x] View Snap
- [x] Automatically delete snap after view

<br>

### :sunny: Recomended updates:
- [ ] Good UI
- [ ] Increase upload speed of images

<br>

### 🛠️ Tools Used:
![android](https://img.shields.io/badge/Android%20Studio-ED8B00?style=for-the-badge&logo=android&logoColor=white)
![Kotlin](https://img.shields.io/badge/Kotlin-0095D5?&style=for-the-badge&logo=kotlin&logoColor=white)
![Firebase](https://img.shields.io/badge/firebase-ffca28?style=for-the-badge&logo=firebase)

<br>

### :confused: How to use:
<p>
<h4>
1. Download android studio (v3 or higer recomended) <br><br>
2. Clone the repository using github CLI<br><br>

` gh repo clone AdityaVSM/SnapChatClone `
<br><br>
3.Setup Firebase Project. Read official documentation to know more about setting up a project in firebase <a href="https://firebase.google.com/docs/build">here<a/><br><br>
4.Enjoy using the app :blush:

<br><br>
<h2>Feel free to contribute:computer:</h2><br>

### Thank you:smile:, Happy coding :muscle:
</h4>
1 change: 1 addition & 0 deletions android_apps/SnapChatClone/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
53 changes: 53 additions & 0 deletions android_apps/SnapChatClone/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "com.example.snapchatclone"
minSdkVersion 26
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation 'com.google.firebase:firebase-auth-ktx:20.0.4'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.google.firebase:firebase-database-ktx'

implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
}
apply plugin: 'com.google.gms.google-services'
39 changes: 39 additions & 0 deletions android_apps/SnapChatClone/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "867489977492",
"project_id": "snapchat-e191b",
"storage_bucket": "snapchat-e191b.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:867489977492:android:cacf17a8c841d166699081",
"android_client_info": {
"package_name": "com.example.snapchatclone"
}
},
"oauth_client": [
{
"client_id": "867489977492-94j0iho548618oh7qiuk98qr4u4t98jd.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBtsCEMkXJbnN56MdwbPYmreylQ6EG5Fkk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "867489977492-94j0iho548618oh7qiuk98qr4u4t98jd.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
21 changes: 21 additions & 0 deletions android_apps/SnapChatClone/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.snapchatclone

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.snapchatclone", appContext.packageName)
}
}
28 changes: 28 additions & 0 deletions android_apps/SnapChatClone/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.snapchatclone">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:usesCleartextTraffic="true"
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/Theme.SnapChatClone">
<activity android:name=".ViewSnapActivity"></activity>
<activity android:name=".ChoseUserActivity" />
<activity android:name=".CreateSnapActivity" />
<activity android:name=".SnapsActivity" />

<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.example.snapchatclone

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.ListView
import com.google.firebase.FirebaseError
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.database.*
import com.google.firebase.ktx.Firebase

class ChoseUserActivity : AppCompatActivity() {
var chooseUserListView: ListView? = null
var emailsArrayList:ArrayList<String> = ArrayList()
var userNameArrayList:ArrayList<String> = ArrayList()
var keys:ArrayList<String> = ArrayList()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_chose_user)

chooseUserListView = findViewById(R.id.chooseUserListView)
val arrayAdapter = ArrayAdapter(this,android.R.layout.simple_list_item_1,userNameArrayList)
chooseUserListView?.adapter = arrayAdapter

var userName = "";
FirebaseDatabase.getInstance().getReference().child("users").addChildEventListener(object :ChildEventListener {
override fun onChildAdded(snapshot: DataSnapshot, previousChildName: String?) {
userName = snapshot?.child("userName")?.value as String
userNameArrayList.add(userName)
keys.add(snapshot.key.toString())
arrayAdapter.notifyDataSetChanged()
}

override fun onChildChanged(snapshot: DataSnapshot, previousChildName: String?) {}
override fun onChildRemoved(snapshot: DataSnapshot) {}
override fun onChildMoved(snapshot: DataSnapshot, previousChildName: String?) {}
override fun onCancelled(error: DatabaseError) {}
})
chooseUserListView?.onItemClickListener = AdapterView.OnItemClickListener { parent, view, position, id ->
val snapMap: Any = mapOf("from" to userName, "imageName" to intent.getStringExtra("imageName"), "imageUrl" to intent.getStringExtra("imageUrl"), "message" to intent.getStringExtra("message")) as Any
FirebaseDatabase.getInstance().getReference().child("users").child(keys.get(position)).child("snaps").push().setValue(snapMap)

val intent = Intent(this,SnapsActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
}

}



}

Loading