diff --git a/Android/JatinGoyal/Advanced/NewsApp/.gitignore b/Android/JatinGoyal/Advanced/NewsApp/.gitignore
new file mode 100644
index 00000000..aa724b77
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.gitignore
@@ -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
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/.gitignore b/Android/JatinGoyal/Advanced/NewsApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/.name b/Android/JatinGoyal/Advanced/NewsApp/.idea/.name
new file mode 100644
index 00000000..9da0a4e5
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/.name
@@ -0,0 +1 @@
+News App
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/compiler.xml b/Android/JatinGoyal/Advanced/NewsApp/.idea/compiler.xml
new file mode 100644
index 00000000..fb7f4a8a
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/gradle.xml b/Android/JatinGoyal/Advanced/NewsApp/.idea/gradle.xml
new file mode 100644
index 00000000..5cd135a0
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/jarRepositories.xml b/Android/JatinGoyal/Advanced/NewsApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..0380d8d3
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/misc.xml b/Android/JatinGoyal/Advanced/NewsApp/.idea/misc.xml
new file mode 100644
index 00000000..6199cc2a
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/.idea/runConfigurations.xml b/Android/JatinGoyal/Advanced/NewsApp/.idea/runConfigurations.xml
new file mode 100644
index 00000000..797acea5
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/.gitignore b/Android/JatinGoyal/Advanced/NewsApp/app/.gitignore
new file mode 100644
index 00000000..42afabfd
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/build.gradle b/Android/JatinGoyal/Advanced/NewsApp/app/build.gradle
new file mode 100644
index 00000000..78e7b0d4
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/build.gradle
@@ -0,0 +1,44 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.example.newsapp"
+ minSdkVersion 23
+ 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
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.3.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation 'androidx.viewpager:viewpager:1.0.0'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+ implementation 'com.koushikdutta.ion:ion:2.+'
+ implementation 'com.squareup.picasso:picasso:2.71828'
+ implementation 'com.squareup.retrofit2:retrofit:2.4.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/proguard-rules.pro b/Android/JatinGoyal/Advanced/NewsApp/app/proguard-rules.pro
new file mode 100644
index 00000000..481bb434
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/proguard-rules.pro
@@ -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
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/androidTest/java/com/example/newsapp/ExampleInstrumentedTest.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/androidTest/java/com/example/newsapp/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..37bb3549
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/androidTest/java/com/example/newsapp/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.newsapp;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.newsapp", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/AndroidManifest.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..6df2065e
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/AndroidManifest.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/APIClient.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/APIClient.java
new file mode 100644
index 00000000..7cc1d595
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/APIClient.java
@@ -0,0 +1,18 @@
+package com.example.newsapp;
+
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+public class APIClient {
+ public static final String BASE_URL = "https://newsapi.org/v2/";
+ private static Retrofit retrofit = null;
+ public static Retrofit getClient() {
+ if (retrofit==null) {
+ retrofit = new Retrofit.Builder()
+ .baseUrl(BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+ }
+ return retrofit;
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/APIInterface.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/APIInterface.java
new file mode 100644
index 00000000..8ad9f7c1
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/APIInterface.java
@@ -0,0 +1,12 @@
+package com.example.newsapp;
+
+import retrofit2.Call;
+import retrofit2.http.GET;
+import retrofit2.http.Query;
+
+public interface APIInterface {
+
+ @GET("top-headlines")
+ Call getCategoryNews(@Query("category") String category, @Query("language") String language, @Query("apiKey") String apiKey);
+
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/Article.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/Article.java
new file mode 100644
index 00000000..80ef27d7
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/Article.java
@@ -0,0 +1,62 @@
+package com.example.newsapp;
+
+import com.google.gson.annotations.SerializedName;
+
+public class Article {
+ @SerializedName("source")
+ private SourceModel source;
+ @SerializedName("author")
+ private String author;
+ @SerializedName("title")
+ private String title;
+ @SerializedName("description")
+ private String description;
+ @SerializedName("url")
+ private String url;
+ @SerializedName("urlToImage")
+ private String urlToImage;
+ @SerializedName("publishedAt")
+ private String publishedAt;
+ public SourceModel getSource() {
+ return source;
+ }
+ public void setSource(SourceModel source) {
+ this.source = source;
+ }
+ public String getAuthor() {
+ return author;
+ }
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+ public String getTitle() {
+ return title;
+ }
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public String getUrl() {
+ return url;
+ }
+ public void setUrl(String url) {
+ this.url = url;
+ }
+ public String getUrlToImage() {
+ return urlToImage;
+ }
+ public void setUrlToImage(String urlToImage) {
+ this.urlToImage = urlToImage;
+ }
+ public String getPublishedAt() {
+ return publishedAt;
+ }
+ public void setPublishedAt(String publishedAt) {
+ this.publishedAt = publishedAt;
+ }
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/DetailsActivity.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/DetailsActivity.java
new file mode 100644
index 00000000..701b3961
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/DetailsActivity.java
@@ -0,0 +1,43 @@
+package com.example.newsapp;
+
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Bundle;
+import android.view.MenuItem;
+import android.webkit.WebView;
+
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class DetailsActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_details);
+
+ WebView editWeb = findViewById(R.id.web);
+ Intent intent = getIntent();
+
+ String url = intent.getStringExtra("url");
+ editWeb.loadUrl(url);
+
+ ActionBar bar = getSupportActionBar();
+ bar.setTitle("NewsApp");
+ bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("blue")));
+
+ bar.setDisplayHomeAsUpEnabled(true);
+ bar.setDisplayShowHomeEnabled(true);
+
+ }
+
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if(item.getItemId() == android.R.id.home)
+ {
+ finish();
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ItemAdapter.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ItemAdapter.java
new file mode 100644
index 00000000..0cfb627e
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ItemAdapter.java
@@ -0,0 +1,105 @@
+package com.example.newsapp;
+
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.squareup.picasso.Picasso;
+
+import java.util.ArrayList;
+
+public class ItemAdapter extends RecyclerView.Adapter {
+
+
+ Context context;
+
+ private final ArrayList items;
+
+ public ItemAdapter(Context context, ArrayList items) {
+ this.context = context;
+ this.items = items;
+
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+ LayoutInflater inflater = LayoutInflater.from(this.context);
+ LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.news, null);
+
+ return new ViewHolder(layout);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ViewHolder holder, final int i) {
+ final ModelItems item = items.get(i);
+
+
+
+ String title = item.getTitle();
+ String author = item.getAuthor();
+ String date = item.getDate();
+ String urlToImage = item.getUrlToImage();
+ final String url = item.getUrl();
+
+
+
+ if(title!=null)
+ holder.editTitle.setText(title);
+ if(author!=null)
+ holder.editauthor.setText("Author "+author);
+ if(date!=null)
+ holder.editdate.setText("published at: "+date);
+ if(urlToImage!=null)
+ Picasso.get().load(urlToImage).into(holder.editUrlImage);
+
+
+ holder.mybutton.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+
+ Intent intent = new Intent(context,DetailsActivity.class);
+ intent.putExtra("url",url);
+ context.startActivity(intent);
+ }
+ });
+
+ }
+
+
+ @Override
+ public int getItemCount() {
+ return items.size();
+ }
+
+ class ViewHolder extends RecyclerView.ViewHolder {
+
+ TextView editTitle,editauthor,editdate;
+ ImageView editUrlImage;
+ Button mybutton;
+ ViewHolder(@NonNull View itemView) {
+ super(itemView);
+
+ editTitle = itemView.findViewById(R.id.tittle1);
+ editUrlImage = itemView.findViewById(R.id.image1);
+ editauthor = itemView.findViewById(R.id.author);
+ editdate = itemView.findViewById(R.id.date);
+ mybutton = itemView.findViewById(R.id.details);
+
+
+ }
+
+ }
+
+
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/MainActivity.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/MainActivity.java
new file mode 100644
index 00000000..dd59abbe
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/MainActivity.java
@@ -0,0 +1,55 @@
+package com.example.newsapp;
+
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Bundle;
+import android.util.Log;
+
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.viewpager.widget.ViewPager;
+
+import com.google.android.material.tabs.TabLayout;
+
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class MainActivity extends AppCompatActivity {
+
+ private TabLayout TabLayout;
+ private ViewPager viewPager;
+ private MyPageAdapter adapter;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ viewPager = findViewById(R.id.viewPager);
+ TabLayout = findViewById(R.id.tablayout);
+
+
+ adapter = new MyPageAdapter(getSupportFragmentManager());
+ viewPager.setAdapter(adapter);
+
+ TabLayout.setTabsFromPagerAdapter(adapter);
+
+
+ // to keep working together of tab layout and view pager
+ TabLayout.setupWithViewPager(viewPager);
+ viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(TabLayout));
+
+
+ // for top bar of activity
+ ActionBar bar = getSupportActionBar();
+ bar.setTitle("NewsApp");
+ bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("blue")));
+
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ModelItems.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ModelItems.java
new file mode 100644
index 00000000..eb369164
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ModelItems.java
@@ -0,0 +1,25 @@
+package com.example.newsapp;
+
+public class ModelItems {
+
+ String title, author, date, urlToImage, url;
+ public ModelItems() {}
+
+ public ModelItems(String title, String author, String date, String urlToImage, String url) {
+ this.title = title;
+ this.author = author;
+ this.date = date;
+ this.urlToImage = urlToImage;
+ this.url = url; }
+
+ public String getTitle() {return title; }
+ public void setTitle(String title) {this.title = title; }
+ public String getAuthor() {return author;}
+ public void setAuthor(String author) {this.author = author;}
+ public String getDate() {return date;}
+ public void setDate(String date) {this.date = date;}
+ public String getUrlToImage() {return urlToImage;}
+ public void setUrlToImage(String urlToImage) {this.urlToImage = urlToImage;}
+ public String getUrl() {return url;}
+ public void setUrl(String url) {this.url = url;}
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/MyPageAdapter.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/MyPageAdapter.java
new file mode 100644
index 00000000..39325890
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/MyPageAdapter.java
@@ -0,0 +1,54 @@
+package com.example.newsapp;
+
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+
+public class MyPageAdapter extends FragmentStatePagerAdapter {
+
+
+
+ public MyPageAdapter(FragmentManager fm) {
+
+ super(fm);
+
+ }
+
+
+ @Override
+ public Fragment getItem(int i) {
+ // Log.e("pra"," "+i);
+ fragment frag = new fragment(i);
+ return frag;
+ }
+
+ @Override
+ public int getCount() {
+ return 7;
+ }
+
+ @Nullable
+ @Override
+ public CharSequence getPageTitle(int position) {
+
+ if(position == 0)
+ return "General";
+ else if(position == 2)
+ return "Sports";
+ else if(position == 4)
+ return "Business";
+ else if(position == 3)
+ return "Technology";
+ else if(position == 1)
+ return "Entertainment";
+ else if(position == 5)
+ return "Science";
+ else if(position == 6)
+ return "Health";
+ else
+ return "hello";
+
+
+ }
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ResponseModel.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ResponseModel.java
new file mode 100644
index 00000000..d748405f
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/ResponseModel.java
@@ -0,0 +1,32 @@
+package com.example.newsapp;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+public class ResponseModel {
+ @SerializedName("status")
+ private String status;
+ @SerializedName("totalResults")
+ private int totalResults;
+ @SerializedName("articles")
+ private List articles = null;
+ public String getStatus() {
+ return status;
+ }
+ public void setStatus(String status) {
+ this.status = status;
+ }
+ public int getTotalResults() {
+ return totalResults;
+ }
+ public void setTotalResults(int totalResults) {
+ this.totalResults = totalResults;
+ }
+ public List getArticles() {
+ return articles;
+ }
+ public void setArticles(List articles) {
+ this.articles = articles;
+ }
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/SourceModel.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/SourceModel.java
new file mode 100644
index 00000000..9af0dd84
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/SourceModel.java
@@ -0,0 +1,22 @@
+package com.example.newsapp;
+
+import com.google.gson.annotations.SerializedName;
+
+class SourceModel {
+ @SerializedName("id")
+ private String id;
+ @SerializedName("name")
+ private String name;
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/fragment.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/fragment.java
new file mode 100644
index 00000000..7e32feb4
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/java/com/example/newsapp/fragment.java
@@ -0,0 +1,117 @@
+package com.example.newsapp;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.koushikdutta.async.future.FutureCallback;
+import com.koushikdutta.ion.Ion;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class fragment extends Fragment {
+
+
+ ArrayList items = new ArrayList <>();
+ ItemAdapter adapter;
+
+ Context context;
+ int pos;
+ public fragment() {
+
+ }
+
+ public fragment(int i) {
+
+ this.pos = i;
+ }
+
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+
+ return inflater.inflate(R.layout.xmlfragment, container, false);
+
+ }
+
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+ final RecyclerView recyclerView = Objects.requireNonNull(getView()).findViewById(R.id.recyclerView);
+
+
+ final APIInterface apiService = APIClient.getClient().create(APIInterface.class);
+ Call call;
+ if (pos == 0) {
+ call = apiService.getCategoryNews("general", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+ else if(pos == 1){
+ call = apiService.getCategoryNews("entertainment", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+ else if(pos == 2){
+ call = apiService.getCategoryNews("sports", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+ else if(pos == 3){
+ call = apiService.getCategoryNews("technology", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+ else if(pos == 4){
+ call = apiService.getCategoryNews("business", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+ else if(pos == 5){
+ call = apiService.getCategoryNews("science", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+ else{
+ call = apiService.getCategoryNews("health", "en", "aae53caa51b2478db36695f18a36141b");
+ }
+
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Callcall, Response response) {
+ assert response.body() != null;
+ if(response.body().getStatus().equals("ok")) {
+ Log.d("main", "success");
+ Log.d("main", String.valueOf(response.body().getTotalResults()));
+ List articleList = response.body().getArticles();
+ for(Article article: articleList) {
+ items.add(new ModelItems(article.getTitle(), article.getAuthor(), article.getPublishedAt(), article.getUrlToImage(), article.getUrl()));
+ }
+
+ adapter = new ItemAdapter(getActivity(), items);
+ recyclerView.setAdapter(adapter);
+
+ LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
+ recyclerView.setLayoutManager(layoutManager);
+ }
+ }
+ @Override
+ public void onFailure(Callcall, Throwable t) {
+ Log.e("out", t.toString());
+ }
+ });
+
+ }
+
+
+
+
+}
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..2b068d11
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable/ic_launcher_background.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..07d5da9c
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable/mybutton.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable/mybutton.xml
new file mode 100644
index 00000000..3685a27d
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/drawable/mybutton.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_details.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_details.xml
new file mode 100644
index 00000000..db05a501
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_details.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_main.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..ec0d5609
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_my_news.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_my_news.xml
new file mode 100644
index 00000000..49f3f34a
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/activity_my_news.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/news.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/news.xml
new file mode 100644
index 00000000..786ae335
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/news.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/xmlfragment.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/xmlfragment.xml
new file mode 100644
index 00000000..b8d6c192
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/layout/xmlfragment.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..a571e600
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..61da551c
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..c41dd285
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..db5080a7
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..6dba46da
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..da31a871
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..15ac6817
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..b216f2d3
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..f25a4197
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..e96783cc
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values-night/themes.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values-night/themes.xml
new file mode 100644
index 00000000..ce9e759f
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/colors.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..133200b4
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #875EE4
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/strings.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..d9d0a3cf
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ News App
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/themes.xml b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/themes.xml
new file mode 100644
index 00000000..77b149cd
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/app/src/test/java/com/example/newsapp/ExampleUnitTest.java b/Android/JatinGoyal/Advanced/NewsApp/app/src/test/java/com/example/newsapp/ExampleUnitTest.java
new file mode 100644
index 00000000..bfbb062e
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/app/src/test/java/com/example/newsapp/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.newsapp;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/build.gradle b/Android/JatinGoyal/Advanced/NewsApp/build.gradle
new file mode 100644
index 00000000..9ade2a75
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/build.gradle
@@ -0,0 +1,25 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.2.1"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ jcenter() // Warning: this repository is going to shut down soon
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/gradle.properties b/Android/JatinGoyal/Advanced/NewsApp/gradle.properties
new file mode 100644
index 00000000..76356a6e
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+android.enableJetifier=true
\ No newline at end of file
diff --git a/Android/JatinGoyal/Advanced/NewsApp/gradle/wrapper/gradle-wrapper.jar b/Android/JatinGoyal/Advanced/NewsApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..f6b961fd
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Android/JatinGoyal/Advanced/NewsApp/gradle/wrapper/gradle-wrapper.properties b/Android/JatinGoyal/Advanced/NewsApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..8e480ec1
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat May 22 14:48:10 IST 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/Android/JatinGoyal/Advanced/NewsApp/gradlew b/Android/JatinGoyal/Advanced/NewsApp/gradlew
new file mode 100644
index 00000000..cccdd3d5
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/Android/JatinGoyal/Advanced/NewsApp/gradlew.bat b/Android/JatinGoyal/Advanced/NewsApp/gradlew.bat
new file mode 100644
index 00000000..f9553162
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Android/JatinGoyal/Advanced/NewsApp/settings.gradle b/Android/JatinGoyal/Advanced/NewsApp/settings.gradle
new file mode 100644
index 00000000..d9bd43c4
--- /dev/null
+++ b/Android/JatinGoyal/Advanced/NewsApp/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = "News App"
+include ':app'
diff --git a/Android/JatinGoyal/Advanced/NewsAppDemo.mp4 b/Android/JatinGoyal/Advanced/NewsAppDemo.mp4
new file mode 100644
index 00000000..df7a31cb
Binary files /dev/null and b/Android/JatinGoyal/Advanced/NewsAppDemo.mp4 differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.gitignore b/Android/JatinGoyal/Beginner/SplashScreen/.gitignore
new file mode 100644
index 00000000..aa724b77
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.gitignore
@@ -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
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/.gitignore b/Android/JatinGoyal/Beginner/SplashScreen/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/.name b/Android/JatinGoyal/Beginner/SplashScreen/.idea/.name
new file mode 100644
index 00000000..a8daa729
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/.name
@@ -0,0 +1 @@
+SplashScreen
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/compiler.xml b/Android/JatinGoyal/Beginner/SplashScreen/.idea/compiler.xml
new file mode 100644
index 00000000..fb7f4a8a
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/gradle.xml b/Android/JatinGoyal/Beginner/SplashScreen/.idea/gradle.xml
new file mode 100644
index 00000000..5cd135a0
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/jarRepositories.xml b/Android/JatinGoyal/Beginner/SplashScreen/.idea/jarRepositories.xml
new file mode 100644
index 00000000..0380d8d3
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/misc.xml b/Android/JatinGoyal/Beginner/SplashScreen/.idea/misc.xml
new file mode 100644
index 00000000..860da66a
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/.idea/runConfigurations.xml b/Android/JatinGoyal/Beginner/SplashScreen/.idea/runConfigurations.xml
new file mode 100644
index 00000000..797acea5
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/.gitignore b/Android/JatinGoyal/Beginner/SplashScreen/app/.gitignore
new file mode 100644
index 00000000..42afabfd
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/build.gradle b/Android/JatinGoyal/Beginner/SplashScreen/app/build.gradle
new file mode 100644
index 00000000..cd4024cd
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/build.gradle
@@ -0,0 +1,39 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.example.splashscreen"
+ minSdkVersion 16
+ 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
+ }
+}
+
+dependencies {
+
+ 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'
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/proguard-rules.pro b/Android/JatinGoyal/Beginner/SplashScreen/app/proguard-rules.pro
new file mode 100644
index 00000000..481bb434
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/proguard-rules.pro
@@ -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
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/androidTest/java/com/example/splashscreen3/ExampleInstrumentedTest.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/androidTest/java/com/example/splashscreen3/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..214c29e5
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/androidTest/java/com/example/splashscreen3/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.splashscreen3;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.splashscreen3", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/AndroidManifest.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..118a6580
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/AndroidManifest.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/FirstFragment.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/FirstFragment.java
new file mode 100644
index 00000000..1297f31c
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/FirstFragment.java
@@ -0,0 +1,32 @@
+package com.example.splashscreen3;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+import androidx.viewpager.widget.ViewPager;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.view.View.OnClickListener;
+import androidx.fragment.app.FragmentManager;
+import androidx.viewpager.widget.ViewPager;
+
+
+public class FirstFragment extends Fragment {
+ ViewPager viewPager;
+ ViewPagerAdapter viewPagerAdapter;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ ViewGroup rootView = (ViewGroup) inflater.inflate(
+ R.layout.first_fragment, container, false);
+
+ return rootView;
+ }
+
+}
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/MainActivity.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/MainActivity.java
new file mode 100644
index 00000000..02db7b69
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/MainActivity.java
@@ -0,0 +1,61 @@
+package com.example.splashscreen3;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.viewpager.widget.ViewPager;
+import androidx.fragment.app.FragmentManager;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+
+public class MainActivity extends AppCompatActivity {
+ ViewPager viewPager;
+ ViewPagerAdapter viewPagerAdapter;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ viewPagerAdapter = new ViewPagerAdapter(this.getSupportFragmentManager()); //view pager adapter
+
+ viewPager = findViewById(R.id.view_pager_intro);
+ viewPager.setAdapter(viewPagerAdapter);
+ }
+
+
+
+ @Override
+ public void onBackPressed() {
+ if (viewPager.getCurrentItem() == 0) {
+ // If the user is currently looking at the first step, allow the system to handle the
+ // Back button. This calls finish() on this activity and pops the back stack.
+ super.onBackPressed();
+ } else {
+ // Otherwise, select the previous step.
+ viewPager.setCurrentItem(viewPager.getCurrentItem() - 1);
+ }
+ }
+
+
+ public void moveNext(View view) {
+ if (viewPager.getCurrentItem() == 2) {
+ return;
+ }
+ else {
+ viewPager.setCurrentItem(viewPager.getCurrentItem() + 1);
+ }
+ }
+
+ public void moveSkip(View view) {
+ viewPager.setCurrentItem(2);
+ }
+
+ public void moveBack(View view){
+ if (viewPager.getCurrentItem() == 0) {
+ return;
+ } else {
+ viewPager.setCurrentItem(viewPager.getCurrentItem() - 1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/SecondFragment.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/SecondFragment.java
new file mode 100644
index 00000000..453c5881
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/SecondFragment.java
@@ -0,0 +1,24 @@
+package com.example.splashscreen3;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.fragment.app.Fragment;
+
+public class SecondFragment extends Fragment {
+ private static final String LOG_TAG = SecondFragment.class.getSimpleName();
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ ViewGroup rootView = (ViewGroup) inflater.inflate(
+ R.layout.second_fragment, container, false);
+
+ return rootView;
+ }
+
+}
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/SplashActivity.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/SplashActivity.java
new file mode 100644
index 00000000..299668e3
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/SplashActivity.java
@@ -0,0 +1,28 @@
+package com.example.splashscreen3;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+
+public class SplashActivity extends Activity {
+ private static final int SPLASH_SCREEN_TIME_OUT=2000;
+
+ Handler handler;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.splash_file);
+
+ handler=new Handler();
+ handler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ Intent intent=new Intent(SplashActivity.this,MainActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ },SPLASH_SCREEN_TIME_OUT);
+
+ }
+}
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/ThirdFragment.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/ThirdFragment.java
new file mode 100644
index 00000000..4876cee1
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/ThirdFragment.java
@@ -0,0 +1,19 @@
+package com.example.splashscreen3;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.fragment.app.Fragment;
+
+public class ThirdFragment extends Fragment {
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ ViewGroup rootView = (ViewGroup) inflater.inflate(
+ R.layout.third_fragment, container, false);
+
+ return rootView;
+ }
+}
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/ViewPagerAdapter.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/ViewPagerAdapter.java
new file mode 100644
index 00000000..5d682996
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/java/com/example/splashscreen/ViewPagerAdapter.java
@@ -0,0 +1,58 @@
+package com.example.splashscreen3;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+public class ViewPagerAdapter extends FragmentPagerAdapter {
+ private static final int TOTAL_PAGES = 3;
+
+ public ViewPagerAdapter(@NonNull FragmentManager fm) {
+ super(fm);
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+
+ Fragment fragment = null;
+ switch (position) {
+ case 0:
+
+ fragment = new FirstFragment();//create any fragment
+
+ break;
+ case 1:
+
+ fragment = new SecondFragment();//create any fragment
+ break;
+ // you may add more cases for more fragments
+ case 2:
+ fragment = new ThirdFragment();
+
+ }
+ assert fragment != null;
+ return fragment;
+ }
+
+ @Override
+ public int getCount() {
+ // Show total number of pages.
+ return TOTAL_PAGES;
+ }
+
+ @Nullable
+ @Override
+ public CharSequence getPageTitle(int position) {
+ if (position == 0) {
+ return "Fragment1";
+ }
+ else if(position == 1) {
+ return "Fragment2";
+ }
+ else{
+ return "Fragment3";
+ }
+ }
+}
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..2b068d11
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/gulab.jpg b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/gulab.jpg
new file mode 100644
index 00000000..40dc2ac7
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/gulab.jpg differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/ic_launcher_background.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..07d5da9c
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/naan.jpg b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/naan.jpg
new file mode 100644
index 00000000..2e207a15
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/naan.jpg differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/paneer.jpg b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/paneer.jpg
new file mode 100644
index 00000000..39163533
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/paneer.jpg differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/restaurant.jpg b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/restaurant.jpg
new file mode 100644
index 00000000..0472055f
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/drawable/restaurant.jpg differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/activity_main.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..ba02abf2
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/first_fragment.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/first_fragment.xml
new file mode 100644
index 00000000..a112ea3f
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/first_fragment.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/second_fragment.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/second_fragment.xml
new file mode 100644
index 00000000..f33e2f3c
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/second_fragment.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/splash_file.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/splash_file.xml
new file mode 100644
index 00000000..cac318df
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/splash_file.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/third_fragment.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/third_fragment.xml
new file mode 100644
index 00000000..a1127b53
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/layout/third_fragment.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..a571e600
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..61da551c
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..c41dd285
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..db5080a7
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..6dba46da
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..da31a871
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..15ac6817
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..b216f2d3
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..f25a4197
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..e96783cc
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values-night/themes.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values-night/themes.xml
new file mode 100644
index 00000000..599b927a
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/colors.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..f8c6127d
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/spider_man_background.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/spider_man_background.xml
new file mode 100644
index 00000000..32fdbed4
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/spider_man_background.xml
@@ -0,0 +1,4 @@
+
+
+ #1580A9
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/strings.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..d5c0aab2
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/strings.xml
@@ -0,0 +1,9 @@
+
+ SplashScreen3
+ Landscape image 1
+ Landscape image 2
+ Landscape image 3
+ NEXT
+ SKIP
+ BACK
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/themes.xml b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/themes.xml
new file mode 100644
index 00000000..932b4e64
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/spider_man-playstore.png b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/spider_man-playstore.png
new file mode 100644
index 00000000..bfcdda2e
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/app/src/main/spider_man-playstore.png differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/app/src/test/java/com/example/splashscreen3/ExampleUnitTest.java b/Android/JatinGoyal/Beginner/SplashScreen/app/src/test/java/com/example/splashscreen3/ExampleUnitTest.java
new file mode 100644
index 00000000..cb9dfa50
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/app/src/test/java/com/example/splashscreen3/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.splashscreen3;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/build.gradle b/Android/JatinGoyal/Beginner/SplashScreen/build.gradle
new file mode 100644
index 00000000..9ade2a75
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/build.gradle
@@ -0,0 +1,25 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.2.1"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ jcenter() // Warning: this repository is going to shut down soon
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/gradle.properties b/Android/JatinGoyal/Beginner/SplashScreen/gradle.properties
new file mode 100644
index 00000000..6826e61b
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
\ No newline at end of file
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/gradle/wrapper/gradle-wrapper.jar b/Android/JatinGoyal/Beginner/SplashScreen/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..f6b961fd
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreen/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/gradle/wrapper/gradle-wrapper.properties b/Android/JatinGoyal/Beginner/SplashScreen/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f8a46d46
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu May 20 23:31:36 IST 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/gradlew b/Android/JatinGoyal/Beginner/SplashScreen/gradlew
new file mode 100644
index 00000000..cccdd3d5
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/gradlew.bat b/Android/JatinGoyal/Beginner/SplashScreen/gradlew.bat
new file mode 100644
index 00000000..f9553162
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Android/JatinGoyal/Beginner/SplashScreen/settings.gradle b/Android/JatinGoyal/Beginner/SplashScreen/settings.gradle
new file mode 100644
index 00000000..08ac2bcf
--- /dev/null
+++ b/Android/JatinGoyal/Beginner/SplashScreen/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = "SplashScreen"
+include ':app'
diff --git a/Android/JatinGoyal/Beginner/SplashScreenDemo.mp4 b/Android/JatinGoyal/Beginner/SplashScreenDemo.mp4
new file mode 100644
index 00000000..5f75a0ad
Binary files /dev/null and b/Android/JatinGoyal/Beginner/SplashScreenDemo.mp4 differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.gitignore b/AndroidLibrary/JatinGoyal/ScannerApp/.gitignore
new file mode 100644
index 00000000..aa724b77
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.gitignore
@@ -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
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.idea/.gitignore b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.idea/compiler.xml b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/compiler.xml
new file mode 100644
index 00000000..fb7f4a8a
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.idea/gradle.xml b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/gradle.xml
new file mode 100644
index 00000000..5cd135a0
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.idea/jarRepositories.xml b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..0380d8d3
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.idea/misc.xml b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/misc.xml
new file mode 100644
index 00000000..860da66a
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/.idea/runConfigurations.xml b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/runConfigurations.xml
new file mode 100644
index 00000000..797acea5
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/.gitignore b/AndroidLibrary/JatinGoyal/ScannerApp/app/.gitignore
new file mode 100644
index 00000000..42afabfd
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/build.gradle b/AndroidLibrary/JatinGoyal/ScannerApp/app/build.gradle
new file mode 100644
index 00000000..b494111e
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/build.gradle
@@ -0,0 +1,41 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ applicationId "com.example.scannerapp"
+ minSdkVersion 24
+ 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
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+ implementation 'com.journeyapps:zxing-android-embedded:4.1.0'
+// compile 'com.android.support:appcompat-v7:23.1.0'
+}
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/proguard-rules.pro b/AndroidLibrary/JatinGoyal/ScannerApp/app/proguard-rules.pro
new file mode 100644
index 00000000..481bb434
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/proguard-rules.pro
@@ -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
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/androidTest/java/com/example/scannerapp/ExampleInstrumentedTest.java b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/androidTest/java/com/example/scannerapp/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..69937493
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/androidTest/java/com/example/scannerapp/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.scannerapp;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.scannerapp", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/AndroidManifest.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..11702865
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/AndroidManifest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/java/com/example/scannerapp/MainActivity.java b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/java/com/example/scannerapp/MainActivity.java
new file mode 100644
index 00000000..c3acb9c0
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/java/com/example/scannerapp/MainActivity.java
@@ -0,0 +1,67 @@
+package com.example.scannerapp;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.zxing.integration.android.IntentIntegrator;
+import com.google.zxing.integration.android.IntentResult;
+
+// implements onClickListener for the onclick behaviour of button
+public class MainActivity extends AppCompatActivity implements View.OnClickListener {
+ Button scanBtn;
+ TextView messageText, messageFormat;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ // referencing and initializing
+ // the button and textviews
+ scanBtn = findViewById(R.id.scanBtn );
+ messageText = findViewById(R.id.textContent);
+ messageFormat = findViewById(R.id.textFormat);
+
+ // adding listener to the button
+ scanBtn.setOnClickListener(this);
+
+ }
+
+ @Override
+ public void onClick(View v) {
+ // we need to create the object
+ // of IntentIntegrator class
+ // which is the class of QR library
+ IntentIntegrator intentIntegrator = new IntentIntegrator(this);
+ intentIntegrator.setPrompt("Scan a QR Code");
+ intentIntegrator.setOrientationLocked(true);
+ intentIntegrator.initiateScan();
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
+ // if the intentResult is null then
+ // toast a message as "cancelled"
+ if (intentResult != null) {
+ if (intentResult.getContents() == null) {
+ Toast.makeText(getBaseContext(), "Cancelled", Toast.LENGTH_SHORT).show();
+ } else {
+ // if the intentResult is not null we'll set
+ // the content and format of scan message
+ messageText.setText(intentResult.getContents());
+ messageFormat.setText(intentResult.getFormatName());
+ }
+ } else {
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+ }
+}
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..2b068d11
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..07d5da9c
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/layout/activity_main.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..749d3c27
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-hdpi/ic_launcher.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..a571e600
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..61da551c
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-mdpi/ic_launcher.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..c41dd285
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..db5080a7
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..6dba46da
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..da31a871
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..15ac6817
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..b216f2d3
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..f25a4197
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..e96783cc
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values-night/themes.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values-night/themes.xml
new file mode 100644
index 00000000..1a79770f
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/colors.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..f8c6127d
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/strings.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..58159475
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ ScannerApp
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/themes.xml b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/themes.xml
new file mode 100644
index 00000000..098c401f
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/app/src/test/java/com/example/scannerapp/ExampleUnitTest.java b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/test/java/com/example/scannerapp/ExampleUnitTest.java
new file mode 100644
index 00000000..5d0f1a0a
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/app/src/test/java/com/example/scannerapp/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.scannerapp;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/build.gradle b/AndroidLibrary/JatinGoyal/ScannerApp/build.gradle
new file mode 100644
index 00000000..9ade2a75
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/build.gradle
@@ -0,0 +1,25 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.2.1"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ jcenter() // Warning: this repository is going to shut down soon
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/gradle.properties b/AndroidLibrary/JatinGoyal/ScannerApp/gradle.properties
new file mode 100644
index 00000000..6826e61b
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
\ No newline at end of file
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/gradle/wrapper/gradle-wrapper.jar b/AndroidLibrary/JatinGoyal/ScannerApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..f6b961fd
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/gradle/wrapper/gradle-wrapper.properties b/AndroidLibrary/JatinGoyal/ScannerApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..86707994
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat May 29 10:35:24 IST 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/gradlew b/AndroidLibrary/JatinGoyal/ScannerApp/gradlew
new file mode 100644
index 00000000..cccdd3d5
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/gradlew.bat b/AndroidLibrary/JatinGoyal/ScannerApp/gradlew.bat
new file mode 100644
index 00000000..f9553162
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/AndroidLibrary/JatinGoyal/ScannerApp/settings.gradle b/AndroidLibrary/JatinGoyal/ScannerApp/settings.gradle
new file mode 100644
index 00000000..509c0c20
--- /dev/null
+++ b/AndroidLibrary/JatinGoyal/ScannerApp/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = "ScannerApp"
+include ':app'
diff --git a/AndroidLibrary/JatinGoyal/ScannerAppDemo.mp4 b/AndroidLibrary/JatinGoyal/ScannerAppDemo.mp4
new file mode 100644
index 00000000..0ce30077
Binary files /dev/null and b/AndroidLibrary/JatinGoyal/ScannerAppDemo.mp4 differ
diff --git a/FastScrollRecyclerView/.gitignore b/FastScrollRecyclerView/.gitignore
new file mode 100644
index 00000000..37a4eb8b
--- /dev/null
+++ b/FastScrollRecyclerView/.gitignore
@@ -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
+/entry/.preview
+.cxx
diff --git a/FastScrollRecyclerView/.idea/.gitignore b/FastScrollRecyclerView/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/FastScrollRecyclerView/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/FastScrollRecyclerView/.idea/compiler.xml b/FastScrollRecyclerView/.idea/compiler.xml
new file mode 100644
index 00000000..61a9130c
--- /dev/null
+++ b/FastScrollRecyclerView/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FastScrollRecyclerView/.idea/gradle.xml b/FastScrollRecyclerView/.idea/gradle.xml
new file mode 100644
index 00000000..b9090f42
--- /dev/null
+++ b/FastScrollRecyclerView/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FastScrollRecyclerView/.idea/jarRepositories.xml b/FastScrollRecyclerView/.idea/jarRepositories.xml
new file mode 100644
index 00000000..1dfcd020
--- /dev/null
+++ b/FastScrollRecyclerView/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FastScrollRecyclerView/.idea/misc.xml b/FastScrollRecyclerView/.idea/misc.xml
new file mode 100644
index 00000000..58918f50
--- /dev/null
+++ b/FastScrollRecyclerView/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/FastScrollRecyclerView/build.gradle b/FastScrollRecyclerView/build.gradle
new file mode 100644
index 00000000..1dc510ff
--- /dev/null
+++ b/FastScrollRecyclerView/build.gradle
@@ -0,0 +1,37 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+}
+
+buildscript {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.huawei.ohos:hap:2.4.2.7'
+ classpath 'com.huawei.ohos:decctest:1.0.0.7'
+ }
+}
+
+allprojects {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+}
diff --git a/FastScrollRecyclerView/entry/.gitignore b/FastScrollRecyclerView/entry/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/FastScrollRecyclerView/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/FastScrollRecyclerView/entry/build.gradle b/FastScrollRecyclerView/entry/build.gradle
new file mode 100644
index 00000000..752a0370
--- /dev/null
+++ b/FastScrollRecyclerView/entry/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+ buildTypes {
+ release {
+ proguardOpt {
+ proguardEnabled false
+ rulesFiles 'proguard-rules.pro'
+ }
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13'
+ ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
+}
+decc {
+ supportType = ['html','xml']
+}
diff --git a/FastScrollRecyclerView/entry/proguard-rules.pro b/FastScrollRecyclerView/entry/proguard-rules.pro
new file mode 100644
index 00000000..f7666e47
--- /dev/null
+++ b/FastScrollRecyclerView/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/main/config.json b/FastScrollRecyclerView/entry/src/main/config.json
new file mode 100644
index 00000000..a4a62f4d
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/config.json
@@ -0,0 +1,49 @@
+{
+ "app": {
+ "bundleName": "com.jaredrummler.fastscrollrecyclerview",
+ "vendor": "jaredrummler",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.jaredrummler.fastscrollrecyclerview",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "name": "com.jaredrummler.fastscrollrecyclerview.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollBar.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollBar.java
new file mode 100644
index 00000000..f72bca62
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollBar.java
@@ -0,0 +1,353 @@
+/*
+ * Copyright (C) 2016 Jared Rummler
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.jaredrummler.fastscrollrecyclerview;
+
+//import android.animation.AnimatorSet;
+//import android.animation.ArgbEvaluator;
+//import android.animation.ObjectAnimator;
+//
+//import android.animation.ValueAnimator;
+//import android.content.res.Resources;
+//import android.content.res.TypedArray;
+//import android.graphics.Canvas;
+import ohos.agp.render.Canvas;
+import ohos.agp.utils.Color;
+import ohos.agp.render.Paint;
+import ohos.agp.utils.Point;
+import ohos.agp.render.Path;
+import ohos.utils.geo.Rect;
+import ohos.agp.components.AttrSet;
+import ohos.agp.animation.AnimatorGroup;
+import ohos.agp.animation.Animator;
+import ohos.multimodalinput.event.TouchEvent;
+
+//import android.graphics.Path;
+//import android.graphics.Point;
+//import android.graphics.Rect;
+//import android.support.annotation.ColorInt;
+//import android.util.AttributeSet;
+//import android.view.MotionEvent;
+//import android.view.ViewConfiguration;
+
+public class FastScrollBar {
+
+ private final static int MAX_TRACK_ALPHA = 30;
+ private final static int SCROLL_BAR_VIS_DURATION = 150;
+
+ private final Rect invalidateRect = new Rect();
+ private final Rect tmpRect = new Rect();
+
+ /*package*/ final Point thumbOffset = new Point(-1, -1);
+ private final Path thumbPath = new Path();
+
+ /*package*/ FastScrollRecyclerView recyclerView;
+ private FastScrollPopup fastScrollPopup;
+
+// private AnimatorSet scrollbarAnimator;
+ private AnimatorGroup scrollbarAnimator;
+
+ private int thumbInactiveColor;
+ private int thumbActiveColor;
+
+ /*package*/ Paint thumbPaint;
+ private int thumbMinWidth;
+ private int thumbMaxWidth;
+ /*package*/ int thumbWidth;
+ /*package*/ int thumbHeight;
+ private int thumbCurvature;
+
+ private Paint trackPaint;
+ private int trackWidth;
+ private float lastTouchY;
+
+ // The inset is the buffer around which a point will still register as a click on the scrollbar
+ private int touchInset;
+
+ private boolean isDragging;
+ private boolean isThumbDetached;
+ private boolean canThumbDetach;
+ private boolean ignoreDragGesture;
+ private boolean showThumbCurvature;
+
+ // This is the offset from the top of the scrollbar when the user first starts touching.
+ // To prevent jumping, this offset is applied as the user scrolls.
+ private int touchOffset;
+
+ public FastScrollBar(FastScrollRecyclerView rv, AttrSet attrs) {
+ TypedArray ta = rv.getContext().obtainStyledAttributes(attrs, R.styleable.FastScrollRecyclerView);
+ Resources res = rv.getResources();
+ showThumbCurvature = ta.getBoolean(R.styleable.FastScrollRecyclerView_fastScrollThumbCurvatureEnabled, false);
+ thumbInactiveColor = ta.getColor(R.styleable.FastScrollRecyclerView_fastScrollThumbInactiveColor,
+ res.getColor(R.color.fastscroll_thumb_inactive_color));
+ thumbActiveColor = ta.getColor(R.styleable.FastScrollRecyclerView_fastScrollThumbActiveColor,
+ res.getColor(R.color.fastscroll_thumb_active_color));
+ int trackColor = ta.getColor(R.styleable.FastScrollRecyclerView_fastScrollTrackColor, Color.BLACK);
+ ta.recycle();
+ recyclerView = rv;
+ fastScrollPopup = new FastScrollPopup(rv, attrs);
+ trackPaint = new Paint();
+ trackPaint.setColor(trackColor);
+ trackPaint.setAlpha(MAX_TRACK_ALPHA);
+ thumbPaint = new Paint();
+ thumbPaint.setAntiAlias(true);
+ thumbPaint.setColor(thumbInactiveColor);
+ thumbPaint.setStyle(Paint.Style.FILL);
+ thumbWidth = thumbMinWidth = res.getDimensionPixelSize(R.dimen.fastscroll_thumb_min_width);
+ thumbMaxWidth = res.getDimensionPixelSize(R.dimen.fastscroll_thumb_max_width);
+ thumbHeight = res.getDimensionPixelSize(R.dimen.fastscroll_thumb_height);
+ thumbCurvature = showThumbCurvature ? thumbMaxWidth - thumbMinWidth : 0;
+ touchInset = res.getDimensionPixelSize(R.dimen.fastscroll_thumb_touch_inset);
+ if (rv.isFastScrollAlwaysEnabled()) {
+ animateScrollbar(true);
+ }
+ }
+
+ public void setDetachThumbOnFastScroll() {
+ canThumbDetach = true;
+ }
+
+ public void reattachThumbToScroll() {
+ isThumbDetached = false;
+ }
+
+ public void setThumbOffset(int x, int y) {
+ if (thumbOffset.getPointX() == x && thumbOffset.getPointY() == y) {
+ return;
+ }
+ invalidateRect
+ .set(thumbOffset.getPointXToInt() - thumbCurvature, thumbOffset.getPointYToInt(), thumbOffset.getPointXToInt() + thumbWidth, thumbOffset.getPointYToInt() + thumbHeight);
+ thumbOffset.modify(x, y);
+ updateThumbPath();
+ invalidateRect
+ .fuse(thumbOffset.getPointXToInt() - thumbCurvature, thumbOffset.getPointYToInt(), thumbOffset.getPointXToInt() + thumbWidth, thumbOffset.getPointYToInt() + thumbHeight);
+ recyclerView.invalidate(invalidateRect);
+ }
+
+ public Point getThumbOffset() {
+ return thumbOffset;
+ }
+
+ // Setter/getter for the thumb bar width for animations
+ public void setThumbWidth(int width) {
+ invalidateRect
+ .set(thumbOffset.getPointXToInt() - thumbCurvature, thumbOffset.getPointYToInt(), thumbOffset.getPointXToInt() + thumbWidth, thumbOffset.getPointYToInt() + thumbHeight);
+ thumbWidth = width;
+ updateThumbPath();
+ invalidateRect
+ .fuse(thumbOffset.getPointXToInt() - thumbCurvature, thumbOffset.getPointYToInt(), thumbOffset.getPointXToInt() + thumbWidth, thumbOffset.getPointYt
+ () + thumbHeight);
+ recyclerView.invalidate(invalidateRect);
+ }
+
+ public int getThumbWidth() {
+ return thumbWidth;
+ }
+
+ // Setter/getter for the track bar width for animations
+ public void setTrackWidth(int width) {
+ invalidateRect.set(thumbOffset.getPointXToInt() - thumbCurvature, 0, thumbOffset.getPointXToInt() + thumbWidth, recyclerView.getHeight());
+ trackWidth = width;
+ updateThumbPath();
+ invalidateRect.fuse(thumbOffset.getPointXToInt() - thumbCurvature, 0, thumbOffset.getPointXToInt() + thumbWidth, recyclerView.getHeight());
+ recyclerView.invalidate(invalidateRect);
+ }
+
+ public int getTrackWidth() {
+ return trackWidth;
+ }
+
+ public int getThumbHeight() {
+ return thumbHeight;
+ }
+
+ public int getThumbMaxWidth() {
+ return thumbMaxWidth;
+ }
+
+ public float getLastTouchY() {
+ return lastTouchY;
+ }
+
+ public boolean isDraggingThumb() {
+ return isDragging;
+ }
+
+ public boolean isThumbDetached() {
+ return isThumbDetached;
+ }
+
+ public void setThumbActiveColor(@ColorInt int color) {
+ thumbActiveColor = color;
+ thumbPaint.setColor(color);
+ recyclerView.invalidate(invalidateRect);
+ }
+
+ public void setThumbInactiveColor(@ColorInt int color) {
+ thumbInactiveColor = color;
+ thumbPaint.setColor(color);
+ recyclerView.invalidate(invalidateRect);
+ }
+
+ public void setTrackColor(@ColorInt int color) {
+ trackPaint.setColor(color);
+ recyclerView.invalidate(invalidateRect);
+ }
+
+ public void setPopupBackgroundColor(@ColorInt int color) {
+ fastScrollPopup.setBackgroundColor(color);
+ }
+
+ public void setPopupTextColor(@ColorInt int color) {
+ fastScrollPopup.setTextColor(color);
+ }
+
+ public FastScrollPopup getFastScrollPopup() {
+ return fastScrollPopup;
+ }
+
+ /**
+ * Handles the touch event and determines whether to show the fast scroller (or updates it if
+ * it is already showing).
+ */
+ protected void handleTouchEvent(TouchEvent ev, int downX, int downY, int lastY) {
+ ViewConfiguration config = ViewConfiguration.get(recyclerView.getContext());
+
+ int action = ev.getAction();
+ int y = (int) ev.getY();
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+ if (isNearThumb(downX, downY)) {
+ touchOffset = downY - thumbOffset.y;
+ }
+ break;
+ case MotionEvent.ACTION_MOVE:
+ // Check if we should start scrolling, but ignore this fastscroll gesture if we have
+ // exceeded some fixed movement
+ ignoreDragGesture |= Math.abs(y - downY) > config.getScaledPagingTouchSlop();
+ if (!isDragging && !ignoreDragGesture && isNearThumb(downX, lastY) &&
+ Math.abs(y - downY) > config.getScaledTouchSlop()) {
+ recyclerView.getParent().requestDisallowInterceptTouchEvent(true);
+ isDragging = true;
+ if (canThumbDetach) {
+ isThumbDetached = true;
+ }
+ touchOffset += (lastY - downY);
+ fastScrollPopup.animateVisibility(true);
+ animateScrollbar(true);
+ }
+ if (isDragging) {
+ // Update the fastscroller section name at this touch position
+ int top = recyclerView.getBackgroundPadding().top;
+ int bottom = recyclerView.getHeight() - recyclerView.getBackgroundPadding().bottom - thumbHeight;
+ float boundedY = (float) Math.max(top, Math.min(bottom, y - touchOffset));
+ String sectionName = recyclerView.scrollToPositionAtProgress((boundedY - top) / (bottom - top));
+ fastScrollPopup.setSectionName(sectionName);
+ fastScrollPopup.animateVisibility(!sectionName.isEmpty());
+ recyclerView.invalidate(fastScrollPopup.updateFastScrollerBounds(recyclerView, lastY));
+ lastTouchY = boundedY;
+ }
+ break;
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ touchOffset = 0;
+ lastTouchY = 0;
+ ignoreDragGesture = false;
+ if (isDragging) {
+ isDragging = false;
+ fastScrollPopup.animateVisibility(false);
+ recyclerView.hideScrollBar();
+ }
+ break;
+ }
+ }
+
+ protected void draw(Canvas canvas) {
+ if (thumbOffset.getPointX() < 0 || thumbOffset.getPointY() < 0) {
+ return;
+ }
+
+ // Draw the scroll bar track and thumb
+ if (trackPaint.getAlpha() > 0) {
+ canvas.drawRect(thumbOffset.getPointX(), 0, thumbOffset.getPointX() + thumbWidth, recyclerView.getHeight(), trackPaint);
+ }
+ canvas.drawPath(thumbPath, thumbPaint);
+
+ // Draw the popup
+ fastScrollPopup.draw(canvas);
+ }
+
+ /**
+ * Animates the width and color of the scrollbar.
+ */
+ protected void animateScrollbar(boolean isScrolling) {
+ if (scrollbarAnimator != null) {
+ scrollbarAnimator.cancel();
+ }
+
+ scrollbarAnimator = new AnimatorGroup();
+ ObjectAnimator trackWidthAnim = ObjectAnimator.ofInt(this, "trackWidth",
+ isScrolling ? thumbMaxWidth : thumbMinWidth);
+ ObjectAnimator thumbWidthAnim = ObjectAnimator.ofInt(this, "thumbWidth",
+ isScrolling ? thumbMaxWidth : thumbMinWidth);
+ scrollbarAnimator.runParallel(trackWidthAnim, thumbWidthAnim);
+ if (thumbActiveColor != thumbInactiveColor) {
+ ValueAnimator colorAnimation = ValueAnimator
+ .ofObject(new ArgbEvaluator(), thumbPaint.getColor(), isScrolling ? thumbActiveColor : thumbInactiveColor);
+ colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+
+ @Override
+ public void onAnimationUpdate(ValueAnimator animator) {
+ thumbPaint.setColor((Integer) animator.getAnimatedValue());
+ recyclerView
+ .invalidate(thumbOffset.x, thumbOffset.y, thumbOffset.x + thumbWidth, thumbOffset.y + thumbHeight);
+ }
+ });
+ scrollbarAnimator.play(colorAnimation);
+ }
+ scrollbarAnimator.setDuration(SCROLL_BAR_VIS_DURATION);
+ scrollbarAnimator.start();
+ }
+
+ /**
+ * Updates the path for the thumb drawable.
+ */
+ private void updateThumbPath() {
+ thumbCurvature = showThumbCurvature ? thumbMaxWidth - thumbWidth : 0;
+ thumbPath.reset();
+ thumbPath.moveTo(thumbOffset.getPointX() + thumbWidth, thumbOffset.getPointY()); // tr
+ thumbPath.lineTo(thumbOffset.getPointX() + thumbWidth, thumbOffset.getPointY() + thumbHeight); // br
+ thumbPath.lineTo(thumbOffset.getPointX(), thumbOffset.getPointY() + thumbHeight); // bl
+ thumbPath.cubicTo(thumbOffset.getPointX(), thumbOffset.getPointY() + thumbHeight,
+ thumbOffset.getPointX() - thumbCurvature,
+ thumbOffset.getPointY() + thumbHeight / 2,
+ thumbOffset.getPointX(), thumbOffset.getPointY()); // bl2tl
+ thumbPath.close();
+ }
+
+ /**
+ * Returns whether the specified points are near the scroll bar bounds.
+ */
+ private boolean isNearThumb(int x, int y) {
+ tmpRect.set((int)thumbOffset.getPointX(), (int)thumbOffset.getPointY(), (int)thumbOffset.getPointX() + thumbWidth,
+ (int)thumbOffset.getPointY() + thumbHeight);
+ tmpRect.fuse(touchInset, touchInset);
+ return tmpRect.isInclude(x, y);
+ }
+
+}
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollPopup.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollPopup.java
new file mode 100644
index 00000000..8ee9efdc
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollPopup.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2016 Jared Rummler
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.jaredrummler.fastscrollrecyclerview;
+
+//import android.animation.Animator;
+//import android.animation.ObjectAnimator;
+//import android.content.res.Resources;
+//import android.content.res.TypedArray;
+//import android.graphics.Canvas;
+//import android.graphics.Color;
+//import android.graphics.Paint;
+import ohos.agp.render.Canvas;
+import ohos.agp.utils.Color;
+import ohos.agp.render.Paint;
+import ohos.agp.animation.Animator;
+import ohos.utils.geo.Rect;
+import ohos.agp.components.AttrSet;
+import ohos.agp.components.Component;
+//import android.graphics.PorterDuff;
+//import android.graphics.Rect;
+//import android.graphics.drawable.Drawable;
+//import android.support.annotation.ColorInt;
+//import android.util.AttributeSet;
+
+/**
+ * The fast scroller popup that shows the section name the list will jump to.
+ */
+public class FastScrollPopup {
+
+ private static final float FAST_SCROLL_OVERLAY_Y_OFFSET_FACTOR = 1.5f;
+
+ private final Rect backgroundBounds = new Rect(); // The absolute bounds of the fast scroller bg
+ private final Rect invalidateRect = new Rect();
+ private final Rect tmpRect = new Rect();
+ private final Rect textBounds = new Rect();
+
+ private FastScrollRecyclerView recyclerView;
+ private Animator alphaAnimator;
+ private Resources resources;
+ private Drawable background;
+ private Paint textPaint;
+ private String sectionName;
+ private int originalBackgroundSize;
+ private float alpha;
+ private boolean visible;
+
+ public FastScrollPopup(FastScrollRecyclerView rv, AttrSet attrs) {
+ TypedArray ta = rv.getContext().obtainStyledAttributes(attrs, R.styleable.FastScrollRecyclerView);
+ recyclerView = rv;
+ resources = rv.getResources();
+ Color bgColor = ta.getColor(R.styleable.FastScrollRecyclerView_fastScrollPopupBackgroundColor, Color.TRANSPARENT);
+ int textColor = ta.getColor(R.styleable.FastScrollRecyclerView_fastScrollPopupTextColor, Color.WHITE);
+ float textSize = ta.getDimension(R.styleable.FastScrollRecyclerView_fastScrollTextSize, resources.getDimensionPixelSize(R.dimen.fastscroll_popup_text_size));
+ originalBackgroundSize = (int) textSize + (int) ta.getDimension(R.styleable.FastScrollRecyclerView_fastScrollPopupPadding, resources.getDimensionPixelSize(R.dimen.fastscroll_popup_default_padding));
+ background = resources.getDrawable(R.drawable.fastscroll_popup_bg);
+ if (bgColor != Color.TRANSPARENT) {
+ background = background.mutate();
+ background.setColorFilter(bgColor, PorterDuff.Mode.SRC_IN);
+ }
+ background.setBounds(0, 0, originalBackgroundSize, originalBackgroundSize);
+ textPaint = new Paint();
+ textPaint.setColor(textColor);
+ textPaint.setAntiAlias(true);
+ textPaint.setTextSize(textSize);
+ ta.recycle();
+ }
+
+ /**
+ * Sets the section name.
+ */
+ protected void setSectionName(String sectionName) {
+ if (!sectionName.equals(this.sectionName)) {
+ this.sectionName = sectionName;
+ textPaint.getTextBounds(sectionName, 0, sectionName.length(), textBounds);
+ // Update the width to use measureText since that is more accurate
+ textBounds.right = (int) (textBounds.left + textPaint.measureText(sectionName));
+ }
+ }
+
+ /**
+ * Updates the bounds for the fast scroller.
+ *
+ * @return the invalidation rect for this update.
+ */
+ protected Rect updateFastScrollerBounds(FastScrollRecyclerView rv, int lastTouchY) {
+ invalidateRect.set(backgroundBounds);
+
+ if (isVisible()) {
+ // Calculate the dimensions and position of the fast scroller popup
+ int edgePadding = rv.getMaxScrollbarWidth();
+ int bgPadding = (originalBackgroundSize - textBounds.height()) / 2;
+ int bgHeight = originalBackgroundSize;
+ int bgWidth = Math.max(originalBackgroundSize, textBounds.width() + (2 * bgPadding));
+ if (Utilities.isRtl(resources)) {
+ backgroundBounds.left = rv.getBackgroundPadding().left + (2 * rv.getMaxScrollbarWidth());
+ backgroundBounds.right = backgroundBounds.left + bgWidth;
+ } else {
+ backgroundBounds.right = rv.getWidth() - rv.getBackgroundPadding().right - (2 * rv.getMaxScrollbarWidth());
+ backgroundBounds.left = backgroundBounds.right - bgWidth;
+ }
+ backgroundBounds.top = lastTouchY - (int) (FAST_SCROLL_OVERLAY_Y_OFFSET_FACTOR * bgHeight);
+ backgroundBounds.top =
+ Math.max(edgePadding, Math.min(backgroundBounds.top, rv.getHeight() - edgePadding - bgHeight));
+ backgroundBounds.bottom = backgroundBounds.top + bgHeight;
+ } else {
+ backgroundBounds.setEmpty();
+ }
+
+ // Combine the old and new fast scroller bounds to create the full invalidate rect
+ invalidateRect.union(backgroundBounds);
+ return invalidateRect;
+ }
+
+ /**
+ * Animates the visibility of the fast scroller popup.
+ */
+ public void animateVisibility(boolean visible) {
+ if (this.visible != visible) {
+ this.visible = visible;
+ if (alphaAnimator != null) {
+ alphaAnimator.cancel();
+ }
+ alphaAnimator = ObjectAnimator.ofFloat(this, "alpha", visible ? 1f : 0f);
+ alphaAnimator.setDuration(visible ? 200 : 150);
+ alphaAnimator.start();
+ }
+ }
+
+ // Setter/getter for the popup alpha for animations
+ public void setAlpha(float alpha) {
+ this.alpha = alpha;
+ recyclerView.invalidate(backgroundBounds);
+ }
+
+ public float getAlpha() {
+ return alpha;
+ }
+
+ public void setBackgroundColor(@ColorInt int color) {
+ background = background.mutate();
+ background.setColorFilter(color, PorterDuff.Mode.SRC_IN);
+ }
+
+ public void setTextColor(@ColorInt int color) {
+ textPaint.setColor(color);
+ }
+
+ public int getHeight() {
+ return originalBackgroundSize;
+ }
+
+ protected void draw(Canvas c) {
+ if (isVisible()) {
+ // Draw the fast scroller popup
+ int restoreCount = c.save(Canvas.MATRIX_SAVE_FLAG);
+ c.translate(backgroundBounds.left, backgroundBounds.top);
+ tmpRect.set(backgroundBounds);
+ tmpRect.offsetTo(0, 0);
+ background.setBounds(tmpRect);
+ background.setAlpha((int) (alpha * 255));
+ background.draw(c);
+ textPaint.setAlpha((int) (alpha * 255));
+ c.drawText(sectionName, (backgroundBounds.width() - textBounds.width()) / 2,
+ backgroundBounds.height() - (backgroundBounds.height() - textBounds.height()) / 2,
+ textPaint);
+ c.restoreToCount(restoreCount);
+ }
+ }
+
+ public boolean isVisible() {
+ return (alpha > 0f) && (sectionName != null);
+ }
+
+}
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollRecyclerView.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollRecyclerView.java
new file mode 100644
index 00000000..b8e0a7e8
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/FastScrollRecyclerView.java
@@ -0,0 +1,484 @@
+/*
+ * Copyright (C) 2016 Jared Rummler
+ * Copyright (C) 2016 Tim Malseed
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.jaredrummler.fastscrollrecyclerview;
+
+
+import ohos.app.Context;
+import ohos.agp.render.Canvas;
+import ohos.utils.geo.Rect;
+import ohos.agp.components.AttrSet;
+import ohos.agp.components.Component;
+//import android.content.res.TypedArray;
+//import android.graphics.Canvas;
+//import android.graphics.Rect;
+import android.support.annotation.ColorInt;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+//import android.util.AttributeSet;
+import ohos.agp.components.ListContainer;
+import android.view.MotionEvent;
+import android.view.View;
+
+/**
+ * A base {@link RecyclerView}, which does the following:
+ *
+ *
+ *
NOT intercept a touch unless the scrolling velocity is below a predefined threshold.
+ *
Enable fast scroller.
+ *
+ */
+public class FastScrollRecyclerView extends ListContainer implements ListContainer.ItemClickedListener {
+
+ private static final int SCROLL_DELTA_THRESHOLD_DP = 4;
+ private static final int DEFAULT_HIDE_DELAY = 1000;
+
+ private final ScrollPositionState scrollPositionState = new ScrollPositionState();
+ private final Rect backgroundPadding = new Rect();
+ /*package*/ FastScrollBar fastScrollBar;
+ /*package*/ boolean fastScrollAlwaysEnabled;
+ private float deltaThreshold;
+ private int hideDelay;
+ /*package*/ int lastDy; // Keeps the last known scrolling delta/velocity along y-axis.
+ private int downX;
+ private int downY;
+ private int lastY;
+
+ final Runnable hide = new Runnable() {
+
+ @Override public void run() {
+ if (!fastScrollBar.isDraggingThumb()) {
+ fastScrollBar.animateScrollbar(false);
+ }
+ }
+ };
+
+ public FastScrollRecyclerView(Context context) {
+ this(context, null);
+ }
+
+ public FastScrollRecyclerView(Context context, AttrSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public FastScrollRecyclerView(Context context, AttrSet attrs, int defStyleAttr) {
+ super(context, attrs, String.valueOf(defStyleAttr));
+ TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.FastScrollRecyclerView);
+ fastScrollAlwaysEnabled = ta.getBoolean(R.styleable.FastScrollRecyclerView_fastScrollAlwaysEnabled, false);
+ hideDelay = ta.getInt(R.styleable.FastScrollRecyclerView_fastScrollHideDelay, DEFAULT_HIDE_DELAY);
+ ta.recycle();
+ deltaThreshold = getResources().getDisplayMetrics().density * SCROLL_DELTA_THRESHOLD_DP;
+ fastScrollBar = new FastScrollBar(this, attrs);
+ fastScrollBar.setDetachThumbOnFastScroll();
+ addOnScrollListener(new OnScrollListener() {
+
+ @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+ if (fastScrollAlwaysEnabled) return;
+ switch (newState) {
+ case SCROLL_STATE_DRAGGING:
+ removeCallbacks(hide);
+ fastScrollBar.animateScrollbar(true);
+ break;
+ case SCROLL_STATE_IDLE:
+ hideScrollBar();
+ break;
+ }
+ }
+
+ @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+ lastDy = dy;
+ onUpdateScrollbar(dy);
+ }
+ });
+ }
+
+ public void reset() {
+ fastScrollBar.reattachThumbToScroll();
+ }
+
+ @Override protected void onFinishInflate() {
+ super.onFinishInflate();
+ addOnItemTouchListener(this);
+ }
+
+ /**
+ * We intercept the touch handling only to support fast scrolling when initiated from the
+ * scroll bar. Otherwise, we fall back to the default RecyclerView touch handling.
+ */
+ @Override public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent ev) {
+ return handleTouchEvent(ev);
+ }
+
+ @Override public void onTouchEvent(RecyclerView rv, MotionEvent ev) {
+ handleTouchEvent(ev);
+ }
+
+ /**
+ * Handles the touch event and determines whether to show the fast scroller (or updates it if
+ * it is already showing).
+ */
+ private boolean handleTouchEvent(MotionEvent ev) {
+ int action = ev.getAction();
+ int x = (int) ev.getX();
+ int y = (int) ev.getY();
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+ // Keep track of the down positions
+ downX = x;
+ downY = lastY = y;
+ if (shouldStopScroll(ev)) {
+ stopScroll();
+ }
+ fastScrollBar.handleTouchEvent(ev, downX, downY, lastY);
+ break;
+ case MotionEvent.ACTION_MOVE:
+ lastY = y;
+ fastScrollBar.handleTouchEvent(ev, downX, downY, lastY);
+ break;
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ onFastScrollCompleted();
+ fastScrollBar.handleTouchEvent(ev, downX, downY, lastY);
+ break;
+ }
+ return fastScrollBar.isDraggingThumb();
+ }
+
+ @Override public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
+ // DO NOT REMOVE, NEEDED IMPLEMENTATION FOR M BUILDS
+ }
+
+ /**
+ * Returns whether this {@link MotionEvent} should trigger the scroll to be stopped.
+ */
+ protected boolean shouldStopScroll(MotionEvent ev) {
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+ if ((Math.abs(lastDy) < deltaThreshold && getScrollState() != RecyclerView.SCROLL_STATE_IDLE)) {
+ // now the touch events are being passed to the {@link WidgetCell} until the
+ // touch sequence goes over the touch slop.
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void updateBackgroundPadding(Rect padding) {
+ backgroundPadding.set(padding);
+ }
+
+ public Rect getBackgroundPadding() {
+ return backgroundPadding;
+ }
+
+ /**
+ * Returns the scroll bar width when the user is scrolling.
+ */
+ public int getMaxScrollbarWidth() {
+ return fastScrollBar.getThumbMaxWidth();
+ }
+
+ /**
+ * Returns the available scroll height:
+ * AvailableScrollHeight = Total height of the all items - last page height
+ *
+ * This assumes that all rows are the same height.
+ */
+ protected int getAvailableScrollHeight(int rowCount, int rowHeight) {
+ int visibleHeight = getHeight() - backgroundPadding.top - backgroundPadding.bottom;
+ int scrollHeight = getPaddingTop() + rowCount * rowHeight + getPaddingBottom();
+ return scrollHeight - visibleHeight;
+ }
+
+ /**
+ * Returns the available scroll bar height:
+ * AvailableScrollBarHeight = Total height of the visible view - thumb height
+ */
+ protected int getAvailableScrollBarHeight() {
+ int visibleHeight = getHeight() - backgroundPadding.top - backgroundPadding.bottom;
+ return visibleHeight - fastScrollBar.getThumbHeight();
+ }
+
+ public boolean isFastScrollAlwaysEnabled() {
+ return fastScrollAlwaysEnabled;
+ }
+
+ protected void hideScrollBar() {
+ if (!fastScrollAlwaysEnabled) {
+ removeCallbacks(hide);
+ postDelayed(hide, hideDelay);
+ }
+ }
+
+ public void setThumbActiveColor(@ColorInt int color) {
+ fastScrollBar.setThumbActiveColor(color);
+ }
+
+ public void setTrackInactiveColor(@ColorInt int color) {
+ fastScrollBar.setThumbInactiveColor(color);
+ }
+
+ public void setPopupBackgroundColor(@ColorInt int color) {
+ fastScrollBar.setPopupBackgroundColor(color);
+ }
+
+ public void setPopupTextColor(@ColorInt int color) {
+ fastScrollBar.setPopupTextColor(color);
+ }
+
+ public FastScrollBar getFastScrollBar() {
+ return fastScrollBar;
+ }
+
+ @Override
+ public void draw(Canvas canvas) {
+ super.draw(canvas);
+
+ // Draw the ScrollBar AFTER the ItemDecorations are drawn over
+ onUpdateScrollbar(0);
+ fastScrollBar.draw(canvas);
+ }
+
+ /**
+ * Updates the scrollbar thumb offset to match the visible scroll of the recycler view. It does
+ * this by mapping the available scroll area of the recycler view to the available space for the
+ * scroll bar.
+ *
+ * @param scrollPosState
+ * the current scroll position
+ * @param rowCount
+ * the number of rows, used to calculate the total scroll height (assumes that
+ * all rows are the same height)
+ */
+ protected void synchronizeScrollBarThumbOffsetToViewScroll(ScrollPositionState scrollPosState, int rowCount) {
+ // Only show the scrollbar if there is height to be scrolled
+ int availableScrollBarHeight = getAvailableScrollBarHeight();
+ int availableScrollHeight = getAvailableScrollHeight(rowCount, scrollPosState.rowHeight);
+ if (availableScrollHeight <= 0) {
+ fastScrollBar.setThumbOffset(-1, -1);
+ return;
+ }
+
+ // Calculate the current scroll position, the scrollY of the recycler view accounts for the
+ // view padding, while the scrollBarY is drawn right up to the background padding (ignoring
+ // padding)
+ int scrollY = getPaddingTop() +
+ Math.round(((scrollPosState.rowIndex - scrollPosState.rowTopOffset) * scrollPosState.rowHeight));
+ int scrollBarY =
+ backgroundPadding.top + (int) (((float) scrollY / availableScrollHeight) * availableScrollBarHeight);
+
+ // Calculate the position and size of the scroll bar
+ int scrollBarX;
+ if (Utilities.isRtl(getResources())) {
+ scrollBarX = backgroundPadding.left;
+ } else {
+ scrollBarX = getWidth() - backgroundPadding.right - fastScrollBar.getThumbWidth();
+ }
+ fastScrollBar.setThumbOffset(scrollBarX, scrollBarY);
+ }
+
+ /**
+ *
Maps the touch (from 0..1) to the adapter position that should be visible.
+ *
+ *
Override in each subclass of this base class.
+ */
+ public String scrollToPositionAtProgress(float touchFraction) {
+ int itemCount = getAdapter().getItemCount();
+ if (itemCount == 0) {
+ return "";
+ }
+ int spanCount = 1;
+ int rowCount = itemCount;
+ if (getLayoutManager() instanceof GridLayoutManager) {
+ spanCount = ((GridLayoutManager) getLayoutManager()).getSpanCount();
+ rowCount = (int) Math.ceil((double) rowCount / spanCount);
+ }
+
+ // Stop the scroller if it is scrolling
+ stopScroll();
+
+ getCurScrollState(scrollPositionState);
+
+ float itemPos = itemCount * touchFraction;
+
+ int availableScrollHeight = getAvailableScrollHeight(rowCount, scrollPositionState.rowHeight);
+
+ //The exact position of our desired item
+ int exactItemPos = (int) (availableScrollHeight * touchFraction);
+
+ //Scroll to the desired item. The offset used here is kind of hard to explain.
+ //If the position we wish to scroll to is, say, position 10.5, we scroll to position 10,
+ //and then offset by 0.5 * rowHeight. This is how we achieve smooth scrolling.
+ LinearLayoutManager layoutManager = ((LinearLayoutManager) getLayoutManager());
+ layoutManager.scrollToPositionWithOffset(spanCount * exactItemPos / scrollPositionState.rowHeight,
+ -(exactItemPos % scrollPositionState.rowHeight));
+
+ if (!(getAdapter() instanceof SectionedAdapter)) {
+ return "";
+ }
+
+ int posInt = (int) ((touchFraction == 1) ? itemPos - 1 : itemPos);
+
+ SectionedAdapter sectionedAdapter = (SectionedAdapter) getAdapter();
+ return sectionedAdapter.getSectionName(posInt);
+ }
+
+ /**
+ *
Updates the bounds for the scrollbar.
+ *
+ *
Override in each subclass of this base class.
+ */
+ public void onUpdateScrollbar(int dy) {
+ int rowCount = getAdapter().getItemCount();
+ if (getLayoutManager() instanceof GridLayoutManager) {
+ int spanCount = ((GridLayoutManager) getLayoutManager()).getSpanCount();
+ rowCount = (int) Math.ceil((double) rowCount / spanCount);
+ }
+ // Skip early if, there are no items.
+ if (rowCount == 0) {
+ fastScrollBar.setThumbOffset(-1, -1);
+ return;
+ }
+
+ // Skip early if, there no child laid out in the container.
+ getCurScrollState(scrollPositionState);
+ if (scrollPositionState.rowIndex < 0) {
+ fastScrollBar.setThumbOffset(-1, -1);
+ return;
+ }
+
+ synchronizeScrollBarThumbOffsetToViewScroll(scrollPositionState, rowCount);
+ }
+
+ /**
+ *
Override in each subclass of this base class.
+ */
+ public void onFastScrollCompleted() {
+ }
+
+ /**
+ * Returns information about the item that the recycler view is currently scrolled to.
+ */
+ protected void getCurScrollState(ScrollPositionState stateOut) {
+ stateOut.rowIndex = -1;
+ stateOut.rowTopOffset = -1;
+ stateOut.rowHeight = -1;
+
+ // Return early if there are no items
+ int rowCount = getAdapter().getItemCount();
+ if (rowCount == 0) {
+ return;
+ }
+
+ View child = getChildAt(0);
+ if (child == null) {
+ return;
+ }
+
+ stateOut.rowIndex = getChildPosition(child);
+ if (getLayoutManager() instanceof GridLayoutManager) {
+ stateOut.rowIndex = stateOut.rowIndex / ((GridLayoutManager) getLayoutManager()).getSpanCount();
+ }
+ stateOut.rowTopOffset = getLayoutManager().getDecoratedTop(child) / (float) child.getHeight();
+ stateOut.rowHeight = calculateRowHeight(child.getHeight());
+ }
+
+ /**
+ * Calculates the row height based on the average of the visible children, to handle scrolling
+ * through children with different heights gracefully
+ */
+ protected int calculateRowHeight(int fallbackHeight) {
+ LayoutManager layoutManager = getLayoutManager();
+
+ if (layoutManager instanceof LinearLayoutManager) {
+ final int firstVisiblePosition = ((LinearLayoutManager) layoutManager).findFirstVisibleItemPosition();
+ final int lastVisiblePosition = ((LinearLayoutManager) layoutManager).findLastVisibleItemPosition();
+
+ if (lastVisiblePosition > firstVisiblePosition) {
+ final int height = getHeight();
+ final int paddingTop = getPaddingTop();
+ final int paddingBottom = getPaddingBottom();
+
+ // How many rows are visible, like 10.5f for 10 rows completely and one halfway visible
+ float visibleRows = 0f;
+
+ for (int position = firstVisiblePosition; position <= lastVisiblePosition; position++) {
+ ViewHolder viewHolder = findViewHolderForLayoutPosition(position);
+ if (viewHolder == null || viewHolder.itemView == null) {
+ continue;
+ }
+
+ final View itemView = viewHolder.itemView;
+ final int itemHeight = itemView.getHeight();
+ if (itemHeight == 0) {
+ continue;
+ }
+
+ // Finds how much of the itemView is actually visible.
+ // This allows smooth changes of the scrollbar thumb height
+ final int visibleHeight = itemHeight
+ - Math.max(0, paddingBottom - layoutManager.getDecoratedTop(itemView)) // How much is cut at the top
+ - Math.max(0, paddingBottom + layoutManager.getDecoratedBottom(itemView) - height); // How much is cut at the bottom
+
+ visibleRows += visibleHeight / (float) itemHeight;
+ }
+
+ return Math.round((height - (paddingTop + paddingBottom)) / visibleRows);
+ }
+ }
+
+ return fallbackHeight;
+ }
+
+ @Override
+ public void onItemClicked(ListContainer listContainer, Component component, int i, long l) {
+
+ }
+
+ /**
+ * Iterface to implement in your {@link RecyclerView.Adapter} to show a popup next to the scroller
+ */
+ public interface SectionedAdapter {
+
+ /**
+ * @param position
+ * the item position
+ * @return the section name for this item
+ */
+ @NonNull String getSectionName(int position);
+ }
+
+ /**
+ * The current scroll state of the recycler view. We use this in onUpdateScrollbar()
+ * and scrollToPositionAtProgress() to determine the scroll position of the recycler view so
+ * that we can calculate what the scroll bar looks like, and where to jump to from the fast
+ * scroller.
+ */
+ public static class ScrollPositionState {
+
+ // The index of the first visible row
+ public int rowIndex;
+ // The offset of the first visible row, in percentage of the height
+ public float rowTopOffset;
+ // The height of a given row (they are currently all the same height)
+ public int rowHeight;
+ }
+
+}
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/MainAbility.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/MainAbility.java
new file mode 100644
index 00000000..599b6dde
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/MainAbility.java
@@ -0,0 +1,13 @@
+package com.jaredrummler.fastscrollrecyclerview;
+
+import com.jaredrummler.fastscrollrecyclerview.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+
+public class MainAbility extends Ability {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setMainRoute(MainAbilitySlice.class.getName());
+ }
+}
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/MyApplication.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/MyApplication.java
new file mode 100644
index 00000000..413ef3b0
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/MyApplication.java
@@ -0,0 +1,10 @@
+package com.jaredrummler.fastscrollrecyclerview;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+ @Override
+ public void onInitialize() {
+ super.onInitialize();
+ }
+}
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/Utilities.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/Utilities.java
new file mode 100644
index 00000000..5313e7e8
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/Utilities.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 Jared Rummler
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.jaredrummler.fastscrollrecyclerview;
+
+import android.content.res.Resources;
+import android.os.Build;
+import android.view.View;
+
+final class Utilities {
+
+ static boolean isRtl(Resources res) {
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 &&
+ res.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
+ }
+
+}
diff --git a/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/slice/MainAbilitySlice.java b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/slice/MainAbilitySlice.java
new file mode 100644
index 00000000..0bb70b0d
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/java/com/jaredrummler/fastscrollrecyclerview/slice/MainAbilitySlice.java
@@ -0,0 +1,23 @@
+package com.jaredrummler.fastscrollrecyclerview.slice;
+
+import com.jaredrummler.fastscrollrecyclerview.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+
+public class MainAbilitySlice extends AbilitySlice {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_ability_main);
+ }
+
+ @Override
+ public void onActive() {
+ super.onActive();
+ }
+
+ @Override
+ public void onForeground(Intent intent) {
+ super.onForeground(intent);
+ }
+}
diff --git a/FastScrollRecyclerView/entry/src/main/resources/base/element/string.json b/FastScrollRecyclerView/entry/src/main/resources/base/element/string.json
new file mode 100644
index 00000000..46692dfd
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "FastScrollRecyclerView"
+ },
+ {
+ "name": "mainability_description",
+ "value": "Java_Phone_Empty Feature Ability"
+ },
+ {
+ "name": "mainability_HelloWorld",
+ "value": "Hello World"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/main/resources/base/graphic/background_ability_main.xml b/FastScrollRecyclerView/entry/src/main/resources/base/graphic/background_ability_main.xml
new file mode 100644
index 00000000..c0c0a3df
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/resources/base/graphic/background_ability_main.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/main/resources/base/layout/ability_main.xml b/FastScrollRecyclerView/entry/src/main/resources/base/layout/ability_main.xml
new file mode 100644
index 00000000..5c05fa29
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/main/resources/base/layout/ability_main.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/main/resources/base/media/icon.png b/FastScrollRecyclerView/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 00000000..ce307a88
Binary files /dev/null and b/FastScrollRecyclerView/entry/src/main/resources/base/media/icon.png differ
diff --git a/FastScrollRecyclerView/entry/src/ohosTest/config.json b/FastScrollRecyclerView/entry/src/ohosTest/config.json
new file mode 100644
index 00000000..1fc61e7a
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/ohosTest/config.json
@@ -0,0 +1,41 @@
+{
+ "app": {
+ "bundleName": "com.jaredrummler.fastscrollrecyclerview",
+ "vendor": "jaredrummler",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.jaredrummler.fastscrollrecyclerview",
+ "name": "testModule",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry_test",
+ "moduleType": "feature",
+ "installationFree": true
+ },
+ "abilities": [
+ {
+ "name": "decc.testkit.runner.EntryAbility",
+ "description": "Test Entry Ability",
+ "icon": "$media:icon",
+ "label": "$string:app_name",
+ "launchType": "standard",
+ "orientation": "landscape",
+ "visible": true,
+ "type": "page"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/ohosTest/java/com/jaredrummler/fastscrollrecyclerview/ExampleOhosTest.java b/FastScrollRecyclerView/entry/src/ohosTest/java/com/jaredrummler/fastscrollrecyclerview/ExampleOhosTest.java
new file mode 100644
index 00000000..3a68f380
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/ohosTest/java/com/jaredrummler/fastscrollrecyclerview/ExampleOhosTest.java
@@ -0,0 +1,14 @@
+package com.jaredrummler.fastscrollrecyclerview;
+
+import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleOhosTest {
+ @Test
+ public void testBundleName() {
+ final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
+ assertEquals("com.jaredrummler.fastscrollrecyclerview", actualBundleName);
+ }
+}
\ No newline at end of file
diff --git a/FastScrollRecyclerView/entry/src/test/java/com/jaredrummler/fastscrollrecyclerview/ExampleTest.java b/FastScrollRecyclerView/entry/src/test/java/com/jaredrummler/fastscrollrecyclerview/ExampleTest.java
new file mode 100644
index 00000000..e12af519
--- /dev/null
+++ b/FastScrollRecyclerView/entry/src/test/java/com/jaredrummler/fastscrollrecyclerview/ExampleTest.java
@@ -0,0 +1,9 @@
+package com.jaredrummler.fastscrollrecyclerview;
+
+import org.junit.Test;
+
+public class ExampleTest {
+ @Test
+ public void onStart() {
+ }
+}
diff --git a/FastScrollRecyclerView/gradle.properties b/FastScrollRecyclerView/gradle.properties
new file mode 100644
index 00000000..0daf1830
--- /dev/null
+++ b/FastScrollRecyclerView/gradle.properties
@@ -0,0 +1,10 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# org.gradle.jvmargs=-Dfile.encoding=GBK
diff --git a/FastScrollRecyclerView/gradle/wrapper/gradle-wrapper.jar b/FastScrollRecyclerView/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..490fda85
Binary files /dev/null and b/FastScrollRecyclerView/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/FastScrollRecyclerView/gradle/wrapper/gradle-wrapper.properties b/FastScrollRecyclerView/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f59159e8
--- /dev/null
+++ b/FastScrollRecyclerView/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/FastScrollRecyclerView/gradlew b/FastScrollRecyclerView/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/FastScrollRecyclerView/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/FastScrollRecyclerView/gradlew.bat b/FastScrollRecyclerView/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/FastScrollRecyclerView/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/FastScrollRecyclerView/settings.gradle b/FastScrollRecyclerView/settings.gradle
new file mode 100644
index 00000000..4773db73
--- /dev/null
+++ b/FastScrollRecyclerView/settings.gradle
@@ -0,0 +1 @@
+include ':entry'
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.gitignore b/HarmonyOS/Day1 Assingment/trainingApp/.gitignore
new file mode 100644
index 00000000..37a4eb8b
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.gitignore
@@ -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
+/entry/.preview
+.cxx
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/.gitignore b/HarmonyOS/Day1 Assingment/trainingApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/compiler.xml b/HarmonyOS/Day1 Assingment/trainingApp/.idea/compiler.xml
new file mode 100644
index 00000000..61a9130c
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/gradle.xml b/HarmonyOS/Day1 Assingment/trainingApp/.idea/gradle.xml
new file mode 100644
index 00000000..b9090f42
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/jarRepositories.xml b/HarmonyOS/Day1 Assingment/trainingApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..1dfcd020
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/misc.xml b/HarmonyOS/Day1 Assingment/trainingApp/.idea/misc.xml
new file mode 100644
index 00000000..58918f50
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json b/HarmonyOS/Day1 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
new file mode 100644
index 00000000..f505e6b9
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh-CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/.idea/previewer/previewConfig.json b/HarmonyOS/Day1 Assingment/trainingApp/.idea/previewer/previewConfig.json
new file mode 100644
index 00000000..0c811855
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/.idea/previewer/previewConfig.json
@@ -0,0 +1,9 @@
+{
+ "1.0.0": {
+ "LastPreviewDevice": {
+ "C:\\Users\\jjati\\DevEcoStudioProjects\\trainingApp\\entry": [
+ "phone"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/build.gradle b/HarmonyOS/Day1 Assingment/trainingApp/build.gradle
new file mode 100644
index 00000000..1dc510ff
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/build.gradle
@@ -0,0 +1,37 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+}
+
+buildscript {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.huawei.ohos:hap:2.4.2.7'
+ classpath 'com.huawei.ohos:decctest:1.0.0.7'
+ }
+}
+
+allprojects {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/.gitignore b/HarmonyOS/Day1 Assingment/trainingApp/entry/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/build.gradle b/HarmonyOS/Day1 Assingment/trainingApp/entry/build.gradle
new file mode 100644
index 00000000..752a0370
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+ buildTypes {
+ release {
+ proguardOpt {
+ proguardEnabled false
+ rulesFiles 'proguard-rules.pro'
+ }
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13'
+ ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
+}
+decc {
+ supportType = ['html','xml']
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/proguard-rules.pro b/HarmonyOS/Day1 Assingment/trainingApp/entry/proguard-rules.pro
new file mode 100644
index 00000000..f7666e47
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/config.json b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/config.json
new file mode 100644
index 00000000..89337b4d
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/config.json
@@ -0,0 +1,49 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "name": "com.example.trainingapp.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
new file mode 100644
index 00000000..bf407ed6
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp;
+
+import com.example.trainingapp.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+
+public class MainAbility extends Ability {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setMainRoute(MainAbilitySlice.class.getName());
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
new file mode 100644
index 00000000..ecf61daa
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
@@ -0,0 +1,10 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+ @Override
+ public void onInitialize() {
+ super.onInitialize();
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
new file mode 100644
index 00000000..4fc101c5
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class LoginSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login);
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
new file mode 100644
index 00000000..2a8fbb41
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
@@ -0,0 +1,30 @@
+package com.example.trainingapp.slice;
+
+import com.example.trainingapp.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.components.Button;
+
+public class MainAbilitySlice extends AbilitySlice {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_ability_main);
+
+ Button bt1 = (Button) findComponentById(ResourceTable.Id_log);
+ Button bt2 = (Button) findComponentById(ResourceTable.Id_sign);
+
+ bt1.setClickedListener(listener -> present(new LoginSlice(), new Intent()));
+ bt2.setClickedListener(listener -> present(new SignupSlice(), new Intent()));
+ }
+
+ @Override
+ public void onActive() {
+ super.onActive();
+ }
+
+ @Override
+ public void onForeground(Intent intent) {
+ super.onForeground(intent);
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
new file mode 100644
index 00000000..adc05d2e
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class SignupSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup);
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/element/string.json b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
new file mode 100644
index 00000000..fb02a338
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "trainingApp"
+ },
+ {
+ "name": "mainability_description",
+ "value": "Java_Phone_Empty Feature Ability"
+ },
+ {
+ "name": "mainability_HelloWorld",
+ "value": "Hello World"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
new file mode 100644
index 00000000..c0c0a3df
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
new file mode 100644
index 00000000..9440f26f
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
new file mode 100644
index 00000000..e9c48c16
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
new file mode 100644
index 00000000..877497ef
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 00000000..ce307a88
Binary files /dev/null and b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png differ
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/ohosTest/config.json b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/ohosTest/config.json
new file mode 100644
index 00000000..0e29531e
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/ohosTest/config.json
@@ -0,0 +1,41 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": "testModule",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry_test",
+ "moduleType": "feature",
+ "installationFree": true
+ },
+ "abilities": [
+ {
+ "name": "decc.testkit.runner.EntryAbility",
+ "description": "Test Entry Ability",
+ "icon": "$media:icon",
+ "label": "$string:app_name",
+ "launchType": "standard",
+ "orientation": "landscape",
+ "visible": true,
+ "type": "page"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
new file mode 100644
index 00000000..3340a0d6
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
@@ -0,0 +1,14 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleOhosTest {
+ @Test
+ public void testBundleName() {
+ final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
+ assertEquals("com.example.trainingapp", actualBundleName);
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
new file mode 100644
index 00000000..b047cceb
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
@@ -0,0 +1,9 @@
+package com.example.trainingapp;
+
+import org.junit.Test;
+
+public class ExampleTest {
+ @Test
+ public void onStart() {
+ }
+}
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/gradle.properties b/HarmonyOS/Day1 Assingment/trainingApp/gradle.properties
new file mode 100644
index 00000000..0daf1830
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/gradle.properties
@@ -0,0 +1,10 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# org.gradle.jvmargs=-Dfile.encoding=GBK
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar b/HarmonyOS/Day1 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..490fda85
Binary files /dev/null and b/HarmonyOS/Day1 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties b/HarmonyOS/Day1 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f59159e8
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/gradlew b/HarmonyOS/Day1 Assingment/trainingApp/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/gradlew.bat b/HarmonyOS/Day1 Assingment/trainingApp/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/HarmonyOS/Day1 Assingment/trainingApp/settings.gradle b/HarmonyOS/Day1 Assingment/trainingApp/settings.gradle
new file mode 100644
index 00000000..4773db73
--- /dev/null
+++ b/HarmonyOS/Day1 Assingment/trainingApp/settings.gradle
@@ -0,0 +1 @@
+include ':entry'
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.gitignore b/HarmonyOS/Day2 Assingment/trainingApp/.gitignore
new file mode 100644
index 00000000..37a4eb8b
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.gitignore
@@ -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
+/entry/.preview
+.cxx
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/.gitignore b/HarmonyOS/Day2 Assingment/trainingApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/compiler.xml b/HarmonyOS/Day2 Assingment/trainingApp/.idea/compiler.xml
new file mode 100644
index 00000000..61a9130c
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/gradle.xml b/HarmonyOS/Day2 Assingment/trainingApp/.idea/gradle.xml
new file mode 100644
index 00000000..b9090f42
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/jarRepositories.xml b/HarmonyOS/Day2 Assingment/trainingApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..1dfcd020
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/misc.xml b/HarmonyOS/Day2 Assingment/trainingApp/.idea/misc.xml
new file mode 100644
index 00000000..58918f50
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json b/HarmonyOS/Day2 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
new file mode 100644
index 00000000..f505e6b9
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh-CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/.idea/previewer/previewConfig.json b/HarmonyOS/Day2 Assingment/trainingApp/.idea/previewer/previewConfig.json
new file mode 100644
index 00000000..0c811855
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/.idea/previewer/previewConfig.json
@@ -0,0 +1,9 @@
+{
+ "1.0.0": {
+ "LastPreviewDevice": {
+ "C:\\Users\\jjati\\DevEcoStudioProjects\\trainingApp\\entry": [
+ "phone"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/build.gradle b/HarmonyOS/Day2 Assingment/trainingApp/build.gradle
new file mode 100644
index 00000000..1dc510ff
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/build.gradle
@@ -0,0 +1,37 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+}
+
+buildscript {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.huawei.ohos:hap:2.4.2.7'
+ classpath 'com.huawei.ohos:decctest:1.0.0.7'
+ }
+}
+
+allprojects {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/.gitignore b/HarmonyOS/Day2 Assingment/trainingApp/entry/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/build.gradle b/HarmonyOS/Day2 Assingment/trainingApp/entry/build.gradle
new file mode 100644
index 00000000..752a0370
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+ buildTypes {
+ release {
+ proguardOpt {
+ proguardEnabled false
+ rulesFiles 'proguard-rules.pro'
+ }
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13'
+ ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
+}
+decc {
+ supportType = ['html','xml']
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/proguard-rules.pro b/HarmonyOS/Day2 Assingment/trainingApp/entry/proguard-rules.pro
new file mode 100644
index 00000000..f7666e47
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/config.json b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/config.json
new file mode 100644
index 00000000..89337b4d
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/config.json
@@ -0,0 +1,49 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "name": "com.example.trainingapp.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
new file mode 100644
index 00000000..bf407ed6
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp;
+
+import com.example.trainingapp.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+
+public class MainAbility extends Ability {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setMainRoute(MainAbilitySlice.class.getName());
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
new file mode 100644
index 00000000..ecf61daa
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
@@ -0,0 +1,10 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+ @Override
+ public void onInitialize() {
+ super.onInitialize();
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
new file mode 100644
index 00000000..4fc101c5
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class LoginSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login);
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
new file mode 100644
index 00000000..2a8fbb41
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
@@ -0,0 +1,30 @@
+package com.example.trainingapp.slice;
+
+import com.example.trainingapp.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.components.Button;
+
+public class MainAbilitySlice extends AbilitySlice {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_ability_main);
+
+ Button bt1 = (Button) findComponentById(ResourceTable.Id_log);
+ Button bt2 = (Button) findComponentById(ResourceTable.Id_sign);
+
+ bt1.setClickedListener(listener -> present(new LoginSlice(), new Intent()));
+ bt2.setClickedListener(listener -> present(new SignupSlice(), new Intent()));
+ }
+
+ @Override
+ public void onActive() {
+ super.onActive();
+ }
+
+ @Override
+ public void onForeground(Intent intent) {
+ super.onForeground(intent);
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
new file mode 100644
index 00000000..368ce272
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
@@ -0,0 +1,114 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.*;
+import java.util.regex.Pattern;
+
+public class SignupSlice extends AbilitySlice {
+ TextField firstName, lastName, email, password, mobile;
+ Text firstError, lastError, emailError, passError, mobileError, radioError;
+ RadioButton maleRadio,femaleRadio;
+ Button signupBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup);
+
+ firstName = (TextField) findComponentById(ResourceTable.Id_first_name);
+ lastName = (TextField) findComponentById((ResourceTable.Id_last_name));
+ email = (TextField) findComponentById(ResourceTable.Id_email);
+ password = (TextField) findComponentById(ResourceTable.Id_password);
+ mobile = (TextField) findComponentById(ResourceTable.Id_mobile);
+
+ maleRadio = (RadioButton) findComponentById(ResourceTable.Id_male);
+ femaleRadio = (RadioButton) findComponentById(ResourceTable.Id_female);
+
+ firstError = (Text) findComponentById(ResourceTable.Id_firstError);
+ lastError = (Text) findComponentById(ResourceTable.Id_lastError);
+ emailError = (Text) findComponentById(ResourceTable.Id_emailError);
+ passError = (Text) findComponentById(ResourceTable.Id_passwordError);
+ mobileError = (Text) findComponentById(ResourceTable.Id_mobileError);
+ radioError = (Text) findComponentById(ResourceTable.Id_radioError);
+
+ signupBtn =(Button) findComponentById(ResourceTable.Id_signup);
+
+ signupBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ checkValidity();
+ }
+ });
+
+ }
+ public boolean isNameValid(TextField name){
+ String str = name.getText();
+ String regex = "[a-zA-Z]+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isEmailValid(TextField email){
+ String str = email.getText();
+ String regex = ".+@.+\\..+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPhoneValid(TextField mobile){
+ String str = mobile.getText();
+ String regex = "[1-9][0-9]{9}";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPassValid(TextField password){
+ String str = password.getText();
+ String regex = ".{5,}";
+ Pattern p = Pattern.compile(regex);
+ return p.matcher(str).matches();
+ }
+
+ public void checkValidity(){
+ if(firstName.getText() == null || firstName.getText().isEmpty() || !isNameValid(firstName)){
+ firstError.setVisibility(Component.VISIBLE);
+ }
+ else{
+ firstError.setVisibility(Component.INVISIBLE);
+ }
+ if(lastName.getText() == null || lastName.getText().isEmpty() || !isNameValid(lastName)){
+ lastError.setVisibility(Component.VISIBLE);
+ }
+ else{
+ lastError.setVisibility(Component.INVISIBLE);
+ }
+ if(email.getText() == null || email.getText().isEmpty() || !isEmailValid(email)){
+ emailError.setVisibility(Component.VISIBLE);
+ }
+ else{
+ emailError.setVisibility(Component.INVISIBLE);
+ }
+ if(mobile.getText() == null || mobile.getText().isEmpty() || !isPhoneValid(mobile)){
+ mobileError.setVisibility(Component.VISIBLE);
+ }
+ else{
+ mobileError.setVisibility(Component.INVISIBLE);
+ }
+ if(password.getText() == null || password.getText().isEmpty() || !isPassValid(password)){
+ passError.setVisibility(Component.VISIBLE);
+ }
+ else{
+ passError.setVisibility(Component.INVISIBLE);
+ }
+ if(!maleRadio.isChecked() && !femaleRadio.isChecked()){
+ radioError.setVisibility(Component.VISIBLE);
+ }
+ else{
+ radioError.setVisibility(Component.INVISIBLE);
+ }
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/element/string.json b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
new file mode 100644
index 00000000..fb02a338
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "trainingApp"
+ },
+ {
+ "name": "mainability_description",
+ "value": "Java_Phone_Empty Feature Ability"
+ },
+ {
+ "name": "mainability_HelloWorld",
+ "value": "Hello World"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
new file mode 100644
index 00000000..c0c0a3df
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
new file mode 100644
index 00000000..9440f26f
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
new file mode 100644
index 00000000..f9fe34fb
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
new file mode 100644
index 00000000..30314ef4
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 00000000..ce307a88
Binary files /dev/null and b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png differ
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/ohosTest/config.json b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/ohosTest/config.json
new file mode 100644
index 00000000..0e29531e
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/ohosTest/config.json
@@ -0,0 +1,41 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": "testModule",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry_test",
+ "moduleType": "feature",
+ "installationFree": true
+ },
+ "abilities": [
+ {
+ "name": "decc.testkit.runner.EntryAbility",
+ "description": "Test Entry Ability",
+ "icon": "$media:icon",
+ "label": "$string:app_name",
+ "launchType": "standard",
+ "orientation": "landscape",
+ "visible": true,
+ "type": "page"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
new file mode 100644
index 00000000..3340a0d6
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
@@ -0,0 +1,14 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleOhosTest {
+ @Test
+ public void testBundleName() {
+ final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
+ assertEquals("com.example.trainingapp", actualBundleName);
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
new file mode 100644
index 00000000..b047cceb
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
@@ -0,0 +1,9 @@
+package com.example.trainingapp;
+
+import org.junit.Test;
+
+public class ExampleTest {
+ @Test
+ public void onStart() {
+ }
+}
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/gradle.properties b/HarmonyOS/Day2 Assingment/trainingApp/gradle.properties
new file mode 100644
index 00000000..0daf1830
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/gradle.properties
@@ -0,0 +1,10 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# org.gradle.jvmargs=-Dfile.encoding=GBK
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar b/HarmonyOS/Day2 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..490fda85
Binary files /dev/null and b/HarmonyOS/Day2 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties b/HarmonyOS/Day2 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f59159e8
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/gradlew b/HarmonyOS/Day2 Assingment/trainingApp/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/gradlew.bat b/HarmonyOS/Day2 Assingment/trainingApp/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/HarmonyOS/Day2 Assingment/trainingApp/settings.gradle b/HarmonyOS/Day2 Assingment/trainingApp/settings.gradle
new file mode 100644
index 00000000..4773db73
--- /dev/null
+++ b/HarmonyOS/Day2 Assingment/trainingApp/settings.gradle
@@ -0,0 +1 @@
+include ':entry'
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.gitignore b/HarmonyOS/Day3 Assingment/trainingApp/.gitignore
new file mode 100644
index 00000000..37a4eb8b
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.gitignore
@@ -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
+/entry/.preview
+.cxx
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/.gitignore b/HarmonyOS/Day3 Assingment/trainingApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/compiler.xml b/HarmonyOS/Day3 Assingment/trainingApp/.idea/compiler.xml
new file mode 100644
index 00000000..61a9130c
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/gradle.xml b/HarmonyOS/Day3 Assingment/trainingApp/.idea/gradle.xml
new file mode 100644
index 00000000..b9090f42
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/jarRepositories.xml b/HarmonyOS/Day3 Assingment/trainingApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..1dfcd020
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/misc.xml b/HarmonyOS/Day3 Assingment/trainingApp/.idea/misc.xml
new file mode 100644
index 00000000..58918f50
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json b/HarmonyOS/Day3 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
new file mode 100644
index 00000000..f505e6b9
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh-CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/.idea/previewer/previewConfig.json b/HarmonyOS/Day3 Assingment/trainingApp/.idea/previewer/previewConfig.json
new file mode 100644
index 00000000..0c811855
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/.idea/previewer/previewConfig.json
@@ -0,0 +1,9 @@
+{
+ "1.0.0": {
+ "LastPreviewDevice": {
+ "C:\\Users\\jjati\\DevEcoStudioProjects\\trainingApp\\entry": [
+ "phone"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/build.gradle b/HarmonyOS/Day3 Assingment/trainingApp/build.gradle
new file mode 100644
index 00000000..1dc510ff
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/build.gradle
@@ -0,0 +1,37 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+}
+
+buildscript {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.huawei.ohos:hap:2.4.2.7'
+ classpath 'com.huawei.ohos:decctest:1.0.0.7'
+ }
+}
+
+allprojects {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/.gitignore b/HarmonyOS/Day3 Assingment/trainingApp/entry/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/build.gradle b/HarmonyOS/Day3 Assingment/trainingApp/entry/build.gradle
new file mode 100644
index 00000000..752a0370
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+ buildTypes {
+ release {
+ proguardOpt {
+ proguardEnabled false
+ rulesFiles 'proguard-rules.pro'
+ }
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13'
+ ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
+}
+decc {
+ supportType = ['html','xml']
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/proguard-rules.pro b/HarmonyOS/Day3 Assingment/trainingApp/entry/proguard-rules.pro
new file mode 100644
index 00000000..f7666e47
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/config.json b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/config.json
new file mode 100644
index 00000000..83cb73f6
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/config.json
@@ -0,0 +1,58 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "name": "com.example.trainingapp.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard"
+ },
+ {
+ "permissions": [
+ "com.example.trainingapp.DataAbilityShellProvider.PROVIDER"
+ ],
+ "name": "com.example.trainingapp.PersonDataAbility",
+ "icon": "$media:icon",
+ "type": "data",
+ "uri": "dataability://com.example.trainingapp.PersonDataAbility"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java
new file mode 100644
index 00000000..89aac61c
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java
@@ -0,0 +1,91 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.DataAbilityHelper;
+import ohos.aafwk.ability.DataAbilityRemoteException;
+import ohos.app.Context;
+import ohos.data.dataability.DataAbilityPredicates;
+import ohos.data.rdb.ValuesBucket;
+import ohos.data.resultset.ResultSet;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.net.Uri;
+
+public class DbUtils {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "DbUtils");
+
+ public static final String BASE_URI = "dataability:///com.example.trainingapp.PersonDataAbility";
+
+ public static final String DATA_PATH = "/person";
+
+ public static final String DB_COLUMN_PERSON_ID = "id";
+
+ public static final String DB_COLUMN_FIRSTNAME = "first_name";
+
+ public static final String DB_COLUMN_LASTNAME = "last_name";
+
+ public static final String DB_COLUMN_GENDER = "gender";
+
+ public static final String DB_COLUMN_EMAIL = "email";
+
+ public static final String DB_COLUMN_PASSWORD = "password";
+
+ public static final String DB_COLUMN_PHONE = "phone";
+
+ public static ResultSet query(Context context, DataAbilityPredicates predicates) {
+ DataAbilityHelper databaseHelper = DataAbilityHelper.creator(context);
+
+ String[] columns = new String[] {DB_COLUMN_PERSON_ID,
+ DB_COLUMN_FIRSTNAME, DB_COLUMN_LASTNAME, DB_COLUMN_GENDER, DB_COLUMN_EMAIL, DB_COLUMN_PHONE, DB_COLUMN_PASSWORD};
+
+ ResultSet resultSet = null;
+
+ try {
+ resultSet = databaseHelper.query(Uri.parse(BASE_URI + DATA_PATH),
+ columns, predicates);
+ } catch (IllegalStateException | DataAbilityRemoteException exception) {
+ HiLog.error(LABEL_LOG, "query: dataRemote exception | illegalStateException");
+ }
+ return resultSet;
+ }
+
+ public static void showDB(Context context) {
+ ResultSet resultSet = DbUtils.query(context, null);
+ if(resultSet == null) {
+ HiLog.error(LABEL_LOG, "resultset empty");
+ return;
+ }
+ if(resultSet.getRowCount()==0) {
+ HiLog.error(LABEL_LOG, "row count 0");
+ return;
+ }
+
+ resultSet.goToFirstRow();
+ do {
+ int id = resultSet.getInt(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PERSON_ID));
+ String name = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_FIRSTNAME));
+ String email = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_EMAIL));
+ String gender = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_GENDER));
+ String password = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PASSWORD));
+ HiLog.info(LABEL_LOG, "query: Id :" + id + " Name :" + name + " Gender :" + gender + " Email :" + email + " Password :" + password);
+ } while (resultSet.goToNextRow());
+ }
+
+ public static void insert(Context context, String firstname, String lastname, String gender, String email, String phone, String password) {
+ DataAbilityHelper databaseHelper = DataAbilityHelper.creator(context);
+
+ ValuesBucket valuesBucket = new ValuesBucket();
+ valuesBucket.putString(DB_COLUMN_FIRSTNAME, firstname);
+ valuesBucket.putString(DB_COLUMN_LASTNAME, lastname);
+ valuesBucket.putString(DB_COLUMN_GENDER, gender);
+ valuesBucket.putString(DB_COLUMN_EMAIL, email);
+ valuesBucket.putString(DB_COLUMN_PHONE, phone);
+ valuesBucket.putString(DB_COLUMN_PASSWORD, password);
+ try {
+ if (databaseHelper.insert(Uri.parse(BASE_URI + DATA_PATH), valuesBucket) != -1) {
+ HiLog.info(LABEL_LOG, "insert successful");
+ }
+ } catch (DataAbilityRemoteException | IllegalStateException exception) {
+ HiLog.error(LABEL_LOG, "insert: dataRemote exception|illegalStateException");
+ }
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
new file mode 100644
index 00000000..bf407ed6
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp;
+
+import com.example.trainingapp.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+
+public class MainAbility extends Ability {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setMainRoute(MainAbilitySlice.class.getName());
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
new file mode 100644
index 00000000..ecf61daa
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
@@ -0,0 +1,10 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+ @Override
+ public void onInitialize() {
+ super.onInitialize();
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java
new file mode 100644
index 00000000..236bcf77
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java
@@ -0,0 +1,134 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.ability.DataAbilityHelper;
+import ohos.aafwk.content.Intent;
+import ohos.data.DatabaseHelper;
+import ohos.data.dataability.DataAbilityUtils;
+import ohos.data.rdb.*;
+import ohos.data.resultset.ResultSet;
+import ohos.data.dataability.DataAbilityPredicates;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.net.Uri;
+import ohos.utils.PacMap;
+
+import java.io.FileDescriptor;
+
+public class PersonDataAbility extends Ability {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "PersonDataAbility");
+
+ private static final String DB_NAME = "persondataability.db";
+
+ private static final String DB_TAB_NAME = "person";
+
+ private static final String DB_COLUMN_PERSON_ID = "id";
+
+ private static final String DB_COLUMN_FIRSTNAME = "first_name";
+
+ private static final String DB_COLUMN_LASTNAME = "last_name";
+
+ private static final String DB_COLUMN_GENDER = "gender";
+
+ private static final String DB_COLUMN_EMAIL = "email";
+
+ private static final String DB_COLUMN_PASSWORD = "password";
+
+ private static final String DB_COLUMN_PHONE = "phone";
+
+ private static final int DB_VERSION = 1;
+
+ private final StoreConfig config = StoreConfig.newDefaultConfig(DB_NAME);
+
+ private RdbStore rdbStore;
+
+ private final RdbOpenCallback rdbOpenCallback = new RdbOpenCallback() {
+ @Override
+ public void onCreate(RdbStore store) {
+ store.executeSql("create table if not exists "
+ + DB_TAB_NAME + " ("
+ + DB_COLUMN_PERSON_ID + " integer primary key autoincrement, "
+ + DB_COLUMN_FIRSTNAME + " text not null, "
+ + DB_COLUMN_LASTNAME + " text not null, "
+ + DB_COLUMN_GENDER + " text not null, "
+ + DB_COLUMN_EMAIL + " text not null, "
+ + DB_COLUMN_PHONE + " text not null, "
+ + DB_COLUMN_PASSWORD + " text not null)");
+ }
+
+ @Override
+ public void onUpgrade(RdbStore store, int oldVersion, int newVersion) {
+ }
+ };
+
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ HiLog.info(LABEL_LOG, "PersonDataAbility onStart");
+
+ DatabaseHelper databaseHelper = new DatabaseHelper(this);
+ rdbStore = databaseHelper.getRdbStore(config, DB_VERSION, rdbOpenCallback, null);
+ }
+
+ @Override
+ public ResultSet query(Uri uri, String[] columns, DataAbilityPredicates predicates) {
+ RdbPredicates rdbPredicates = DataAbilityUtils.createRdbPredicates(predicates, DB_TAB_NAME);
+ ResultSet resultSet = rdbStore.query(rdbPredicates, columns);
+ if (resultSet == null) {
+ HiLog.info(LABEL_LOG, "resultSet is null");
+ }
+ return resultSet;
+ }
+
+ @Override
+ public int insert(Uri uri, ValuesBucket value) {
+ HiLog.info(LABEL_LOG, "PersonDataAbility insert");
+ String path = uri.getLastPath();
+ if (!"person".equals(path)) {
+ HiLog.info(LABEL_LOG, "DataAbility insert path is not matched");
+ return -1;
+ }
+ ValuesBucket values = new ValuesBucket();
+ values.putInteger(DB_COLUMN_PERSON_ID, value.getInteger(DB_COLUMN_PERSON_ID));
+ values.putString(DB_COLUMN_FIRSTNAME, value.getString(DB_COLUMN_FIRSTNAME));
+ values.putString(DB_COLUMN_LASTNAME, value.getString(DB_COLUMN_LASTNAME));
+ values.putString(DB_COLUMN_GENDER, value.getString(DB_COLUMN_GENDER));
+ values.putString(DB_COLUMN_EMAIL, value.getString(DB_COLUMN_EMAIL));
+ values.putString(DB_COLUMN_PHONE, value.getString(DB_COLUMN_PHONE));
+ values.putString(DB_COLUMN_PASSWORD, value.getString(DB_COLUMN_PASSWORD));
+
+ int index = (int) rdbStore.insert(DB_TAB_NAME, values);
+ DataAbilityHelper.creator(this, uri).notifyChange(uri);
+ return index;
+ }
+
+ @Override
+ public int delete(Uri uri, DataAbilityPredicates predicates) {
+ return 0;
+ }
+
+ @Override
+ public int update(Uri uri, ValuesBucket value, DataAbilityPredicates predicates) {
+ return 0;
+ }
+
+ @Override
+ public FileDescriptor openFile(Uri uri, String mode) {
+ return null;
+ }
+
+ @Override
+ public String[] getFileTypes(Uri uri, String mimeTypeFilter) {
+ return new String[0];
+ }
+
+ @Override
+ public PacMap call(String method, String arg, PacMap extras) {
+ return null;
+ }
+
+ @Override
+ public String getType(Uri uri) {
+ return null;
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
new file mode 100644
index 00000000..c28f12a7
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
@@ -0,0 +1,63 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.Text;
+import ohos.agp.components.TextField;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.data.dataability.DataAbilityPredicates;
+import com.example.trainingapp.DbUtils;
+import ohos.data.resultset.ResultSet;
+
+public class LoginSlice extends AbilitySlice {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "LoginSlice");
+
+ TextField email, password;
+ Text loginError;
+ Button loginBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login);
+
+ email = (TextField) findComponentById(ResourceTable.Id_emailLogin);
+ password = (TextField) findComponentById(ResourceTable.Id_passwordLogin);
+ loginError = (Text) findComponentById(ResourceTable.Id_loginError);
+ loginBtn = (Button) findComponentById(ResourceTable.Id_loginButton);
+
+ loginBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ validateUser();
+ }
+ });
+ }
+
+ private void validateUser() {
+ loginError.setText(null);
+ DataAbilityPredicates predicates = new DataAbilityPredicates();
+ predicates.equalTo(DbUtils.DB_COLUMN_EMAIL, email.getText());
+ predicates.equalTo(DbUtils.DB_COLUMN_PASSWORD, password.getText());
+
+ ResultSet resultSet = DbUtils.query(this, predicates);
+ if(resultSet == null || resultSet.getRowCount()==0) {
+ HiLog.error(LABEL_LOG, "resultset empty || getrowcount = 0");
+ loginError.setVisibility(Component.VISIBLE);
+ return;
+ }
+
+ resultSet.goToFirstRow();
+ int id = resultSet.getInt(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PERSON_ID));
+ String name = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_FIRSTNAME));
+ String email = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_EMAIL));
+ String gender = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_GENDER));
+ HiLog.info(LABEL_LOG, "query: Id :" + id + " Name :" + name + " Gender :" + gender + " Email :" + email);
+
+ present(new LoginSuccessSlice(), new Intent());
+
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java
new file mode 100644
index 00000000..c50ce89e
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class LoginSuccessSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login_success);
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
new file mode 100644
index 00000000..2a8fbb41
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
@@ -0,0 +1,30 @@
+package com.example.trainingapp.slice;
+
+import com.example.trainingapp.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.components.Button;
+
+public class MainAbilitySlice extends AbilitySlice {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_ability_main);
+
+ Button bt1 = (Button) findComponentById(ResourceTable.Id_log);
+ Button bt2 = (Button) findComponentById(ResourceTable.Id_sign);
+
+ bt1.setClickedListener(listener -> present(new LoginSlice(), new Intent()));
+ bt2.setClickedListener(listener -> present(new SignupSlice(), new Intent()));
+ }
+
+ @Override
+ public void onActive() {
+ super.onActive();
+ }
+
+ @Override
+ public void onForeground(Intent intent) {
+ super.onForeground(intent);
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
new file mode 100644
index 00000000..118d856f
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
@@ -0,0 +1,136 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import com.example.trainingapp.DbUtils;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.*;
+import java.util.regex.Pattern;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+
+public class SignupSlice extends AbilitySlice {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "SignupSlice");
+ TextField firstName, lastName, email, password, mobile;
+ Text firstError, lastError, emailError, passError, mobileError, radioError;
+ RadioButton maleRadio,femaleRadio;
+ Button signupBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup);
+
+
+ firstName = (TextField) findComponentById(ResourceTable.Id_first_name);
+ lastName = (TextField) findComponentById((ResourceTable.Id_last_name));
+ email = (TextField) findComponentById(ResourceTable.Id_email);
+ password = (TextField) findComponentById(ResourceTable.Id_password);
+ mobile = (TextField) findComponentById(ResourceTable.Id_phone);
+
+ maleRadio = (RadioButton) findComponentById(ResourceTable.Id_male);
+ femaleRadio = (RadioButton) findComponentById(ResourceTable.Id_female);
+
+ firstError = (Text) findComponentById(ResourceTable.Id_firstError);
+ lastError = (Text) findComponentById(ResourceTable.Id_lastError);
+ emailError = (Text) findComponentById(ResourceTable.Id_emailError);
+ passError = (Text) findComponentById(ResourceTable.Id_passwordError);
+ mobileError = (Text) findComponentById(ResourceTable.Id_phoneError);
+ radioError = (Text) findComponentById(ResourceTable.Id_radioError);
+
+ signupBtn =(Button) findComponentById(ResourceTable.Id_signup);
+
+ signupBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ if(checkValidity() == true){
+ String gender;
+ if(maleRadio.isChecked()) gender = "Male";
+ else gender = "Female";
+ DbUtils.insert(SignupSlice.this, firstName.getText(), lastName.getText(), gender, email.getText(), mobile.getText(), password.getText());
+ HiLog.info(LABEL_LOG, "User registered");
+ DbUtils.showDB(SignupSlice.this);
+
+ present(new SignupSuccessSlice(), new Intent());
+ }
+ }
+ });
+
+ }
+ public boolean isNameValid(TextField name){
+ String str = name.getText();
+ String regex = "[a-zA-Z]+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isEmailValid(TextField email){
+ String str = email.getText();
+ String regex = ".+@.+\\..+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPhoneValid(TextField mobile){
+ String str = mobile.getText();
+ String regex = "[1-9][0-9]{9}";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPassValid(TextField password){
+ String str = password.getText();
+ String regex = ".{5,}";
+ Pattern p = Pattern.compile(regex);
+ return p.matcher(str).matches();
+ }
+
+ public boolean checkValidity(){
+ boolean b = true;
+ if(firstName.getText() == null || firstName.getText().isEmpty() || !isNameValid(firstName)){
+ firstError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ firstError.setVisibility(Component.INVISIBLE);
+ }
+ if(lastName.getText() == null || lastName.getText().isEmpty() || !isNameValid(lastName)){
+ lastError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ lastError.setVisibility(Component.INVISIBLE);
+ }
+ if(email.getText() == null || email.getText().isEmpty() || !isEmailValid(email)){
+ emailError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ emailError.setVisibility(Component.INVISIBLE);
+ }
+ if(mobile.getText() == null || mobile.getText().isEmpty() || !isPhoneValid(mobile)){
+ mobileError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ mobileError.setVisibility(Component.INVISIBLE);
+ }
+ if(password.getText() == null || password.getText().isEmpty() || !isPassValid(password)){
+ passError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ passError.setVisibility(Component.INVISIBLE);
+ }
+ if(!maleRadio.isChecked() && !femaleRadio.isChecked()){
+ radioError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ radioError.setVisibility(Component.INVISIBLE);
+ }
+ return b;
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java
new file mode 100644
index 00000000..93414cbe
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class SignupSuccessSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup_success);
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/element/string.json b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
new file mode 100644
index 00000000..fb02a338
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "trainingApp"
+ },
+ {
+ "name": "mainability_description",
+ "value": "Java_Phone_Empty Feature Ability"
+ },
+ {
+ "name": "mainability_HelloWorld",
+ "value": "Hello World"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
new file mode 100644
index 00000000..c0c0a3df
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
new file mode 100644
index 00000000..9440f26f
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
new file mode 100644
index 00000000..f9fe34fb
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml
new file mode 100644
index 00000000..11d27d8a
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
new file mode 100644
index 00000000..9b0527a0
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml
new file mode 100644
index 00000000..a362048b
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 00000000..ce307a88
Binary files /dev/null and b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png differ
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/ohosTest/config.json b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/ohosTest/config.json
new file mode 100644
index 00000000..0e29531e
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/ohosTest/config.json
@@ -0,0 +1,41 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": "testModule",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry_test",
+ "moduleType": "feature",
+ "installationFree": true
+ },
+ "abilities": [
+ {
+ "name": "decc.testkit.runner.EntryAbility",
+ "description": "Test Entry Ability",
+ "icon": "$media:icon",
+ "label": "$string:app_name",
+ "launchType": "standard",
+ "orientation": "landscape",
+ "visible": true,
+ "type": "page"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
new file mode 100644
index 00000000..3340a0d6
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
@@ -0,0 +1,14 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleOhosTest {
+ @Test
+ public void testBundleName() {
+ final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
+ assertEquals("com.example.trainingapp", actualBundleName);
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
new file mode 100644
index 00000000..b047cceb
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
@@ -0,0 +1,9 @@
+package com.example.trainingapp;
+
+import org.junit.Test;
+
+public class ExampleTest {
+ @Test
+ public void onStart() {
+ }
+}
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/gradle.properties b/HarmonyOS/Day3 Assingment/trainingApp/gradle.properties
new file mode 100644
index 00000000..0daf1830
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/gradle.properties
@@ -0,0 +1,10 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# org.gradle.jvmargs=-Dfile.encoding=GBK
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar b/HarmonyOS/Day3 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..490fda85
Binary files /dev/null and b/HarmonyOS/Day3 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties b/HarmonyOS/Day3 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f59159e8
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/gradlew b/HarmonyOS/Day3 Assingment/trainingApp/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/gradlew.bat b/HarmonyOS/Day3 Assingment/trainingApp/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/HarmonyOS/Day3 Assingment/trainingApp/settings.gradle b/HarmonyOS/Day3 Assingment/trainingApp/settings.gradle
new file mode 100644
index 00000000..4773db73
--- /dev/null
+++ b/HarmonyOS/Day3 Assingment/trainingApp/settings.gradle
@@ -0,0 +1 @@
+include ':entry'
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.gitignore b/HarmonyOS/Day4 Assingment/trainingApp/.gitignore
new file mode 100644
index 00000000..37a4eb8b
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.gitignore
@@ -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
+/entry/.preview
+.cxx
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/.gitignore b/HarmonyOS/Day4 Assingment/trainingApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/compiler.xml b/HarmonyOS/Day4 Assingment/trainingApp/.idea/compiler.xml
new file mode 100644
index 00000000..61a9130c
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/gradle.xml b/HarmonyOS/Day4 Assingment/trainingApp/.idea/gradle.xml
new file mode 100644
index 00000000..b9090f42
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/jarRepositories.xml b/HarmonyOS/Day4 Assingment/trainingApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..1dfcd020
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/misc.xml b/HarmonyOS/Day4 Assingment/trainingApp/.idea/misc.xml
new file mode 100644
index 00000000..58918f50
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json b/HarmonyOS/Day4 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
new file mode 100644
index 00000000..f505e6b9
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh-CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/.idea/previewer/previewConfig.json b/HarmonyOS/Day4 Assingment/trainingApp/.idea/previewer/previewConfig.json
new file mode 100644
index 00000000..0c811855
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/.idea/previewer/previewConfig.json
@@ -0,0 +1,9 @@
+{
+ "1.0.0": {
+ "LastPreviewDevice": {
+ "C:\\Users\\jjati\\DevEcoStudioProjects\\trainingApp\\entry": [
+ "phone"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/build.gradle b/HarmonyOS/Day4 Assingment/trainingApp/build.gradle
new file mode 100644
index 00000000..1dc510ff
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/build.gradle
@@ -0,0 +1,37 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+}
+
+buildscript {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.huawei.ohos:hap:2.4.2.7'
+ classpath 'com.huawei.ohos:decctest:1.0.0.7'
+ }
+}
+
+allprojects {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/.gitignore b/HarmonyOS/Day4 Assingment/trainingApp/entry/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/build.gradle b/HarmonyOS/Day4 Assingment/trainingApp/entry/build.gradle
new file mode 100644
index 00000000..752a0370
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+ buildTypes {
+ release {
+ proguardOpt {
+ proguardEnabled false
+ rulesFiles 'proguard-rules.pro'
+ }
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13'
+ ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
+}
+decc {
+ supportType = ['html','xml']
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/proguard-rules.pro b/HarmonyOS/Day4 Assingment/trainingApp/entry/proguard-rules.pro
new file mode 100644
index 00000000..f7666e47
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/config.json b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/config.json
new file mode 100644
index 00000000..83cb73f6
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/config.json
@@ -0,0 +1,58 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "name": "com.example.trainingapp.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard"
+ },
+ {
+ "permissions": [
+ "com.example.trainingapp.DataAbilityShellProvider.PROVIDER"
+ ],
+ "name": "com.example.trainingapp.PersonDataAbility",
+ "icon": "$media:icon",
+ "type": "data",
+ "uri": "dataability://com.example.trainingapp.PersonDataAbility"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java
new file mode 100644
index 00000000..89aac61c
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java
@@ -0,0 +1,91 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.DataAbilityHelper;
+import ohos.aafwk.ability.DataAbilityRemoteException;
+import ohos.app.Context;
+import ohos.data.dataability.DataAbilityPredicates;
+import ohos.data.rdb.ValuesBucket;
+import ohos.data.resultset.ResultSet;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.net.Uri;
+
+public class DbUtils {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "DbUtils");
+
+ public static final String BASE_URI = "dataability:///com.example.trainingapp.PersonDataAbility";
+
+ public static final String DATA_PATH = "/person";
+
+ public static final String DB_COLUMN_PERSON_ID = "id";
+
+ public static final String DB_COLUMN_FIRSTNAME = "first_name";
+
+ public static final String DB_COLUMN_LASTNAME = "last_name";
+
+ public static final String DB_COLUMN_GENDER = "gender";
+
+ public static final String DB_COLUMN_EMAIL = "email";
+
+ public static final String DB_COLUMN_PASSWORD = "password";
+
+ public static final String DB_COLUMN_PHONE = "phone";
+
+ public static ResultSet query(Context context, DataAbilityPredicates predicates) {
+ DataAbilityHelper databaseHelper = DataAbilityHelper.creator(context);
+
+ String[] columns = new String[] {DB_COLUMN_PERSON_ID,
+ DB_COLUMN_FIRSTNAME, DB_COLUMN_LASTNAME, DB_COLUMN_GENDER, DB_COLUMN_EMAIL, DB_COLUMN_PHONE, DB_COLUMN_PASSWORD};
+
+ ResultSet resultSet = null;
+
+ try {
+ resultSet = databaseHelper.query(Uri.parse(BASE_URI + DATA_PATH),
+ columns, predicates);
+ } catch (IllegalStateException | DataAbilityRemoteException exception) {
+ HiLog.error(LABEL_LOG, "query: dataRemote exception | illegalStateException");
+ }
+ return resultSet;
+ }
+
+ public static void showDB(Context context) {
+ ResultSet resultSet = DbUtils.query(context, null);
+ if(resultSet == null) {
+ HiLog.error(LABEL_LOG, "resultset empty");
+ return;
+ }
+ if(resultSet.getRowCount()==0) {
+ HiLog.error(LABEL_LOG, "row count 0");
+ return;
+ }
+
+ resultSet.goToFirstRow();
+ do {
+ int id = resultSet.getInt(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PERSON_ID));
+ String name = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_FIRSTNAME));
+ String email = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_EMAIL));
+ String gender = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_GENDER));
+ String password = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PASSWORD));
+ HiLog.info(LABEL_LOG, "query: Id :" + id + " Name :" + name + " Gender :" + gender + " Email :" + email + " Password :" + password);
+ } while (resultSet.goToNextRow());
+ }
+
+ public static void insert(Context context, String firstname, String lastname, String gender, String email, String phone, String password) {
+ DataAbilityHelper databaseHelper = DataAbilityHelper.creator(context);
+
+ ValuesBucket valuesBucket = new ValuesBucket();
+ valuesBucket.putString(DB_COLUMN_FIRSTNAME, firstname);
+ valuesBucket.putString(DB_COLUMN_LASTNAME, lastname);
+ valuesBucket.putString(DB_COLUMN_GENDER, gender);
+ valuesBucket.putString(DB_COLUMN_EMAIL, email);
+ valuesBucket.putString(DB_COLUMN_PHONE, phone);
+ valuesBucket.putString(DB_COLUMN_PASSWORD, password);
+ try {
+ if (databaseHelper.insert(Uri.parse(BASE_URI + DATA_PATH), valuesBucket) != -1) {
+ HiLog.info(LABEL_LOG, "insert successful");
+ }
+ } catch (DataAbilityRemoteException | IllegalStateException exception) {
+ HiLog.error(LABEL_LOG, "insert: dataRemote exception|illegalStateException");
+ }
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
new file mode 100644
index 00000000..bf407ed6
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp;
+
+import com.example.trainingapp.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+
+public class MainAbility extends Ability {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setMainRoute(MainAbilitySlice.class.getName());
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
new file mode 100644
index 00000000..ecf61daa
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
@@ -0,0 +1,10 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+ @Override
+ public void onInitialize() {
+ super.onInitialize();
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java
new file mode 100644
index 00000000..236bcf77
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java
@@ -0,0 +1,134 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.ability.DataAbilityHelper;
+import ohos.aafwk.content.Intent;
+import ohos.data.DatabaseHelper;
+import ohos.data.dataability.DataAbilityUtils;
+import ohos.data.rdb.*;
+import ohos.data.resultset.ResultSet;
+import ohos.data.dataability.DataAbilityPredicates;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.net.Uri;
+import ohos.utils.PacMap;
+
+import java.io.FileDescriptor;
+
+public class PersonDataAbility extends Ability {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "PersonDataAbility");
+
+ private static final String DB_NAME = "persondataability.db";
+
+ private static final String DB_TAB_NAME = "person";
+
+ private static final String DB_COLUMN_PERSON_ID = "id";
+
+ private static final String DB_COLUMN_FIRSTNAME = "first_name";
+
+ private static final String DB_COLUMN_LASTNAME = "last_name";
+
+ private static final String DB_COLUMN_GENDER = "gender";
+
+ private static final String DB_COLUMN_EMAIL = "email";
+
+ private static final String DB_COLUMN_PASSWORD = "password";
+
+ private static final String DB_COLUMN_PHONE = "phone";
+
+ private static final int DB_VERSION = 1;
+
+ private final StoreConfig config = StoreConfig.newDefaultConfig(DB_NAME);
+
+ private RdbStore rdbStore;
+
+ private final RdbOpenCallback rdbOpenCallback = new RdbOpenCallback() {
+ @Override
+ public void onCreate(RdbStore store) {
+ store.executeSql("create table if not exists "
+ + DB_TAB_NAME + " ("
+ + DB_COLUMN_PERSON_ID + " integer primary key autoincrement, "
+ + DB_COLUMN_FIRSTNAME + " text not null, "
+ + DB_COLUMN_LASTNAME + " text not null, "
+ + DB_COLUMN_GENDER + " text not null, "
+ + DB_COLUMN_EMAIL + " text not null, "
+ + DB_COLUMN_PHONE + " text not null, "
+ + DB_COLUMN_PASSWORD + " text not null)");
+ }
+
+ @Override
+ public void onUpgrade(RdbStore store, int oldVersion, int newVersion) {
+ }
+ };
+
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ HiLog.info(LABEL_LOG, "PersonDataAbility onStart");
+
+ DatabaseHelper databaseHelper = new DatabaseHelper(this);
+ rdbStore = databaseHelper.getRdbStore(config, DB_VERSION, rdbOpenCallback, null);
+ }
+
+ @Override
+ public ResultSet query(Uri uri, String[] columns, DataAbilityPredicates predicates) {
+ RdbPredicates rdbPredicates = DataAbilityUtils.createRdbPredicates(predicates, DB_TAB_NAME);
+ ResultSet resultSet = rdbStore.query(rdbPredicates, columns);
+ if (resultSet == null) {
+ HiLog.info(LABEL_LOG, "resultSet is null");
+ }
+ return resultSet;
+ }
+
+ @Override
+ public int insert(Uri uri, ValuesBucket value) {
+ HiLog.info(LABEL_LOG, "PersonDataAbility insert");
+ String path = uri.getLastPath();
+ if (!"person".equals(path)) {
+ HiLog.info(LABEL_LOG, "DataAbility insert path is not matched");
+ return -1;
+ }
+ ValuesBucket values = new ValuesBucket();
+ values.putInteger(DB_COLUMN_PERSON_ID, value.getInteger(DB_COLUMN_PERSON_ID));
+ values.putString(DB_COLUMN_FIRSTNAME, value.getString(DB_COLUMN_FIRSTNAME));
+ values.putString(DB_COLUMN_LASTNAME, value.getString(DB_COLUMN_LASTNAME));
+ values.putString(DB_COLUMN_GENDER, value.getString(DB_COLUMN_GENDER));
+ values.putString(DB_COLUMN_EMAIL, value.getString(DB_COLUMN_EMAIL));
+ values.putString(DB_COLUMN_PHONE, value.getString(DB_COLUMN_PHONE));
+ values.putString(DB_COLUMN_PASSWORD, value.getString(DB_COLUMN_PASSWORD));
+
+ int index = (int) rdbStore.insert(DB_TAB_NAME, values);
+ DataAbilityHelper.creator(this, uri).notifyChange(uri);
+ return index;
+ }
+
+ @Override
+ public int delete(Uri uri, DataAbilityPredicates predicates) {
+ return 0;
+ }
+
+ @Override
+ public int update(Uri uri, ValuesBucket value, DataAbilityPredicates predicates) {
+ return 0;
+ }
+
+ @Override
+ public FileDescriptor openFile(Uri uri, String mode) {
+ return null;
+ }
+
+ @Override
+ public String[] getFileTypes(Uri uri, String mimeTypeFilter) {
+ return new String[0];
+ }
+
+ @Override
+ public PacMap call(String method, String arg, PacMap extras) {
+ return null;
+ }
+
+ @Override
+ public String getType(Uri uri) {
+ return null;
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
new file mode 100644
index 00000000..753076be
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
@@ -0,0 +1,63 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.Text;
+import ohos.agp.components.TextField;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.data.dataability.DataAbilityPredicates;
+import com.example.trainingapp.DbUtils;
+import ohos.data.resultset.ResultSet;
+
+public class LoginSlice extends AbilitySlice {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "LoginSlice");
+
+ TextField email, password;
+ Text loginError;
+ Button loginBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login);
+
+ email = (TextField) findComponentById(ResourceTable.Id_emailLogin);
+ password = (TextField) findComponentById(ResourceTable.Id_passwordLogin);
+ loginError = (Text) findComponentById(ResourceTable.Id_loginError);
+ loginBtn = (Button) findComponentById(ResourceTable.Id_loginButton);
+
+ loginBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ validateUser();
+ }
+ });
+ }
+
+ private void validateUser() {
+ loginError.setText(null);
+ DataAbilityPredicates predicates = new DataAbilityPredicates();
+ predicates.equalTo(DbUtils.DB_COLUMN_EMAIL, email.getText());
+ predicates.equalTo(DbUtils.DB_COLUMN_PASSWORD, password.getText());
+
+ ResultSet resultSet = DbUtils.query(this, predicates);
+ if(resultSet == null || resultSet.getRowCount()==0) {
+ HiLog.error(LABEL_LOG, "resultset empty || getrowcount = 0");
+ loginError.setVisibility(Component.VISIBLE);
+ return;
+ }
+
+ resultSet.goToFirstRow();
+ int id = resultSet.getInt(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PERSON_ID));
+ String name = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_FIRSTNAME));
+ String email = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_EMAIL));
+ String gender = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_GENDER));
+ HiLog.info(LABEL_LOG, "query: Id :" + id + " Name :" + name + " Gender :" + gender + " Email :" + email);
+
+ present(new LoginSuccessSlice(), new Intent());
+
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java
new file mode 100644
index 00000000..c50ce89e
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class LoginSuccessSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login_success);
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
new file mode 100644
index 00000000..8527312d
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
@@ -0,0 +1,49 @@
+package com.example.trainingapp.slice;
+
+import com.example.trainingapp.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.animation.AnimatorProperty;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.Image;
+
+public class MainAbilitySlice extends AbilitySlice {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_ability_main);
+
+ Button bt1 = (Button) findComponentById(ResourceTable.Id_log);
+ Button bt2 = (Button) findComponentById(ResourceTable.Id_sign);
+
+ Image img = (Image) findComponentById(ResourceTable.Id_icon);
+ AnimatorProperty animatorProperty = img.createAnimatorProperty();
+ animatorProperty.moveFromX(50).moveToX(50).rotate(180).alpha(0).setDuration(2500).setDelay(500).setLoopedCount(-1);
+
+ img.setBindStateChangedListener(new Component.BindStateChangedListener() {
+ @Override
+ public void onComponentBoundToWindow(Component component) {
+ animatorProperty.start();
+ }
+
+ @Override
+ public void onComponentUnboundFromWindow(Component component) {
+ animatorProperty.stop();
+ }
+ });
+
+ bt1.setClickedListener(listener -> present(new LoginSlice(), new Intent()));
+ bt2.setClickedListener(listener -> present(new SignupSlice(), new Intent()));
+ }
+
+ @Override
+ public void onActive() {
+ super.onActive();
+ }
+
+ @Override
+ public void onForeground(Intent intent) {
+ super.onForeground(intent);
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
new file mode 100644
index 00000000..118d856f
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
@@ -0,0 +1,136 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import com.example.trainingapp.DbUtils;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.*;
+import java.util.regex.Pattern;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+
+public class SignupSlice extends AbilitySlice {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "SignupSlice");
+ TextField firstName, lastName, email, password, mobile;
+ Text firstError, lastError, emailError, passError, mobileError, radioError;
+ RadioButton maleRadio,femaleRadio;
+ Button signupBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup);
+
+
+ firstName = (TextField) findComponentById(ResourceTable.Id_first_name);
+ lastName = (TextField) findComponentById((ResourceTable.Id_last_name));
+ email = (TextField) findComponentById(ResourceTable.Id_email);
+ password = (TextField) findComponentById(ResourceTable.Id_password);
+ mobile = (TextField) findComponentById(ResourceTable.Id_phone);
+
+ maleRadio = (RadioButton) findComponentById(ResourceTable.Id_male);
+ femaleRadio = (RadioButton) findComponentById(ResourceTable.Id_female);
+
+ firstError = (Text) findComponentById(ResourceTable.Id_firstError);
+ lastError = (Text) findComponentById(ResourceTable.Id_lastError);
+ emailError = (Text) findComponentById(ResourceTable.Id_emailError);
+ passError = (Text) findComponentById(ResourceTable.Id_passwordError);
+ mobileError = (Text) findComponentById(ResourceTable.Id_phoneError);
+ radioError = (Text) findComponentById(ResourceTable.Id_radioError);
+
+ signupBtn =(Button) findComponentById(ResourceTable.Id_signup);
+
+ signupBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ if(checkValidity() == true){
+ String gender;
+ if(maleRadio.isChecked()) gender = "Male";
+ else gender = "Female";
+ DbUtils.insert(SignupSlice.this, firstName.getText(), lastName.getText(), gender, email.getText(), mobile.getText(), password.getText());
+ HiLog.info(LABEL_LOG, "User registered");
+ DbUtils.showDB(SignupSlice.this);
+
+ present(new SignupSuccessSlice(), new Intent());
+ }
+ }
+ });
+
+ }
+ public boolean isNameValid(TextField name){
+ String str = name.getText();
+ String regex = "[a-zA-Z]+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isEmailValid(TextField email){
+ String str = email.getText();
+ String regex = ".+@.+\\..+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPhoneValid(TextField mobile){
+ String str = mobile.getText();
+ String regex = "[1-9][0-9]{9}";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPassValid(TextField password){
+ String str = password.getText();
+ String regex = ".{5,}";
+ Pattern p = Pattern.compile(regex);
+ return p.matcher(str).matches();
+ }
+
+ public boolean checkValidity(){
+ boolean b = true;
+ if(firstName.getText() == null || firstName.getText().isEmpty() || !isNameValid(firstName)){
+ firstError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ firstError.setVisibility(Component.INVISIBLE);
+ }
+ if(lastName.getText() == null || lastName.getText().isEmpty() || !isNameValid(lastName)){
+ lastError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ lastError.setVisibility(Component.INVISIBLE);
+ }
+ if(email.getText() == null || email.getText().isEmpty() || !isEmailValid(email)){
+ emailError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ emailError.setVisibility(Component.INVISIBLE);
+ }
+ if(mobile.getText() == null || mobile.getText().isEmpty() || !isPhoneValid(mobile)){
+ mobileError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ mobileError.setVisibility(Component.INVISIBLE);
+ }
+ if(password.getText() == null || password.getText().isEmpty() || !isPassValid(password)){
+ passError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ passError.setVisibility(Component.INVISIBLE);
+ }
+ if(!maleRadio.isChecked() && !femaleRadio.isChecked()){
+ radioError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ radioError.setVisibility(Component.INVISIBLE);
+ }
+ return b;
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java
new file mode 100644
index 00000000..93414cbe
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class SignupSuccessSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup_success);
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/element/string.json b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
new file mode 100644
index 00000000..fb02a338
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "trainingApp"
+ },
+ {
+ "name": "mainability_description",
+ "value": "Java_Phone_Empty Feature Ability"
+ },
+ {
+ "name": "mainability_HelloWorld",
+ "value": "Hello World"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
new file mode 100644
index 00000000..c0c0a3df
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
new file mode 100644
index 00000000..13cf948e
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
new file mode 100644
index 00000000..f9fe34fb
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml
new file mode 100644
index 00000000..11d27d8a
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
new file mode 100644
index 00000000..9b0527a0
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml
new file mode 100644
index 00000000..a362048b
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 00000000..ce307a88
Binary files /dev/null and b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png differ
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/ohosTest/config.json b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/ohosTest/config.json
new file mode 100644
index 00000000..0e29531e
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/ohosTest/config.json
@@ -0,0 +1,41 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": "testModule",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry_test",
+ "moduleType": "feature",
+ "installationFree": true
+ },
+ "abilities": [
+ {
+ "name": "decc.testkit.runner.EntryAbility",
+ "description": "Test Entry Ability",
+ "icon": "$media:icon",
+ "label": "$string:app_name",
+ "launchType": "standard",
+ "orientation": "landscape",
+ "visible": true,
+ "type": "page"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
new file mode 100644
index 00000000..3340a0d6
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
@@ -0,0 +1,14 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleOhosTest {
+ @Test
+ public void testBundleName() {
+ final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
+ assertEquals("com.example.trainingapp", actualBundleName);
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
new file mode 100644
index 00000000..b047cceb
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
@@ -0,0 +1,9 @@
+package com.example.trainingapp;
+
+import org.junit.Test;
+
+public class ExampleTest {
+ @Test
+ public void onStart() {
+ }
+}
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/gradle.properties b/HarmonyOS/Day4 Assingment/trainingApp/gradle.properties
new file mode 100644
index 00000000..0daf1830
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/gradle.properties
@@ -0,0 +1,10 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# org.gradle.jvmargs=-Dfile.encoding=GBK
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar b/HarmonyOS/Day4 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..490fda85
Binary files /dev/null and b/HarmonyOS/Day4 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties b/HarmonyOS/Day4 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f59159e8
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/gradlew b/HarmonyOS/Day4 Assingment/trainingApp/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/gradlew.bat b/HarmonyOS/Day4 Assingment/trainingApp/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/HarmonyOS/Day4 Assingment/trainingApp/settings.gradle b/HarmonyOS/Day4 Assingment/trainingApp/settings.gradle
new file mode 100644
index 00000000..4773db73
--- /dev/null
+++ b/HarmonyOS/Day4 Assingment/trainingApp/settings.gradle
@@ -0,0 +1 @@
+include ':entry'
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.gitignore b/HarmonyOS/Day5 Assingment/trainingApp/.gitignore
new file mode 100644
index 00000000..37a4eb8b
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.gitignore
@@ -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
+/entry/.preview
+.cxx
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/.gitignore b/HarmonyOS/Day5 Assingment/trainingApp/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/compiler.xml b/HarmonyOS/Day5 Assingment/trainingApp/.idea/compiler.xml
new file mode 100644
index 00000000..61a9130c
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/gradle.xml b/HarmonyOS/Day5 Assingment/trainingApp/.idea/gradle.xml
new file mode 100644
index 00000000..b9090f42
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/jarRepositories.xml b/HarmonyOS/Day5 Assingment/trainingApp/.idea/jarRepositories.xml
new file mode 100644
index 00000000..1dfcd020
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/misc.xml b/HarmonyOS/Day5 Assingment/trainingApp/.idea/misc.xml
new file mode 100644
index 00000000..58918f50
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json b/HarmonyOS/Day5 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
new file mode 100644
index 00000000..f505e6b9
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/previewer/phone/phoneSettingConfig_1825807532.json
@@ -0,0 +1,25 @@
+{
+ "setting": {
+ "1.0.1": {
+ "Language": {
+ "args": {
+ "Language": "zh-CN"
+ }
+ }
+ }
+ },
+ "frontend": {
+ "1.0.0": {
+ "Resolution": {
+ "args": {
+ "Resolution": "360*780"
+ }
+ },
+ "DeviceType": {
+ "args": {
+ "DeviceType": "phone"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/.idea/previewer/previewConfig.json b/HarmonyOS/Day5 Assingment/trainingApp/.idea/previewer/previewConfig.json
new file mode 100644
index 00000000..0c811855
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/.idea/previewer/previewConfig.json
@@ -0,0 +1,9 @@
+{
+ "1.0.0": {
+ "LastPreviewDevice": {
+ "C:\\Users\\jjati\\DevEcoStudioProjects\\trainingApp\\entry": [
+ "phone"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/build.gradle b/HarmonyOS/Day5 Assingment/trainingApp/build.gradle
new file mode 100644
index 00000000..1dc510ff
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/build.gradle
@@ -0,0 +1,37 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply plugin: 'com.huawei.ohos.app'
+
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+}
+
+buildscript {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.huawei.ohos:hap:2.4.2.7'
+ classpath 'com.huawei.ohos:decctest:1.0.0.7'
+ }
+}
+
+allprojects {
+ repositories {
+ maven {
+ url 'https://repo.huaweicloud.com/repository/maven/'
+ }
+ maven {
+ url 'https://developer.huawei.com/repo/'
+ }
+ jcenter()
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/.gitignore b/HarmonyOS/Day5 Assingment/trainingApp/entry/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/build.gradle b/HarmonyOS/Day5 Assingment/trainingApp/entry/build.gradle
new file mode 100644
index 00000000..752a0370
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.huawei.ohos.hap'
+apply plugin: 'com.huawei.ohos.decctest'
+ohos {
+ compileSdkVersion 5
+ defaultConfig {
+ compatibleSdkVersion 5
+ }
+ buildTypes {
+ release {
+ proguardOpt {
+ proguardEnabled false
+ rulesFiles 'proguard-rules.pro'
+ }
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+ testImplementation 'junit:junit:4.13'
+ ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
+}
+decc {
+ supportType = ['html','xml']
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/proguard-rules.pro b/HarmonyOS/Day5 Assingment/trainingApp/entry/proguard-rules.pro
new file mode 100644
index 00000000..f7666e47
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/proguard-rules.pro
@@ -0,0 +1 @@
+# config module specific ProGuard rules here.
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/config.json b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/config.json
new file mode 100644
index 00000000..83cb73f6
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/config.json
@@ -0,0 +1,58 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "name": "com.example.trainingapp.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard"
+ },
+ {
+ "permissions": [
+ "com.example.trainingapp.DataAbilityShellProvider.PROVIDER"
+ ],
+ "name": "com.example.trainingapp.PersonDataAbility",
+ "icon": "$media:icon",
+ "type": "data",
+ "uri": "dataability://com.example.trainingapp.PersonDataAbility"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java
new file mode 100644
index 00000000..89aac61c
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/DbUtils.java
@@ -0,0 +1,91 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.DataAbilityHelper;
+import ohos.aafwk.ability.DataAbilityRemoteException;
+import ohos.app.Context;
+import ohos.data.dataability.DataAbilityPredicates;
+import ohos.data.rdb.ValuesBucket;
+import ohos.data.resultset.ResultSet;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.net.Uri;
+
+public class DbUtils {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "DbUtils");
+
+ public static final String BASE_URI = "dataability:///com.example.trainingapp.PersonDataAbility";
+
+ public static final String DATA_PATH = "/person";
+
+ public static final String DB_COLUMN_PERSON_ID = "id";
+
+ public static final String DB_COLUMN_FIRSTNAME = "first_name";
+
+ public static final String DB_COLUMN_LASTNAME = "last_name";
+
+ public static final String DB_COLUMN_GENDER = "gender";
+
+ public static final String DB_COLUMN_EMAIL = "email";
+
+ public static final String DB_COLUMN_PASSWORD = "password";
+
+ public static final String DB_COLUMN_PHONE = "phone";
+
+ public static ResultSet query(Context context, DataAbilityPredicates predicates) {
+ DataAbilityHelper databaseHelper = DataAbilityHelper.creator(context);
+
+ String[] columns = new String[] {DB_COLUMN_PERSON_ID,
+ DB_COLUMN_FIRSTNAME, DB_COLUMN_LASTNAME, DB_COLUMN_GENDER, DB_COLUMN_EMAIL, DB_COLUMN_PHONE, DB_COLUMN_PASSWORD};
+
+ ResultSet resultSet = null;
+
+ try {
+ resultSet = databaseHelper.query(Uri.parse(BASE_URI + DATA_PATH),
+ columns, predicates);
+ } catch (IllegalStateException | DataAbilityRemoteException exception) {
+ HiLog.error(LABEL_LOG, "query: dataRemote exception | illegalStateException");
+ }
+ return resultSet;
+ }
+
+ public static void showDB(Context context) {
+ ResultSet resultSet = DbUtils.query(context, null);
+ if(resultSet == null) {
+ HiLog.error(LABEL_LOG, "resultset empty");
+ return;
+ }
+ if(resultSet.getRowCount()==0) {
+ HiLog.error(LABEL_LOG, "row count 0");
+ return;
+ }
+
+ resultSet.goToFirstRow();
+ do {
+ int id = resultSet.getInt(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PERSON_ID));
+ String name = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_FIRSTNAME));
+ String email = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_EMAIL));
+ String gender = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_GENDER));
+ String password = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PASSWORD));
+ HiLog.info(LABEL_LOG, "query: Id :" + id + " Name :" + name + " Gender :" + gender + " Email :" + email + " Password :" + password);
+ } while (resultSet.goToNextRow());
+ }
+
+ public static void insert(Context context, String firstname, String lastname, String gender, String email, String phone, String password) {
+ DataAbilityHelper databaseHelper = DataAbilityHelper.creator(context);
+
+ ValuesBucket valuesBucket = new ValuesBucket();
+ valuesBucket.putString(DB_COLUMN_FIRSTNAME, firstname);
+ valuesBucket.putString(DB_COLUMN_LASTNAME, lastname);
+ valuesBucket.putString(DB_COLUMN_GENDER, gender);
+ valuesBucket.putString(DB_COLUMN_EMAIL, email);
+ valuesBucket.putString(DB_COLUMN_PHONE, phone);
+ valuesBucket.putString(DB_COLUMN_PASSWORD, password);
+ try {
+ if (databaseHelper.insert(Uri.parse(BASE_URI + DATA_PATH), valuesBucket) != -1) {
+ HiLog.info(LABEL_LOG, "insert successful");
+ }
+ } catch (DataAbilityRemoteException | IllegalStateException exception) {
+ HiLog.error(LABEL_LOG, "insert: dataRemote exception|illegalStateException");
+ }
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
new file mode 100644
index 00000000..bf407ed6
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MainAbility.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp;
+
+import com.example.trainingapp.slice.MainAbilitySlice;
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.content.Intent;
+
+public class MainAbility extends Ability {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setMainRoute(MainAbilitySlice.class.getName());
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
new file mode 100644
index 00000000..ecf61daa
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/MyApplication.java
@@ -0,0 +1,10 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.AbilityPackage;
+
+public class MyApplication extends AbilityPackage {
+ @Override
+ public void onInitialize() {
+ super.onInitialize();
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java
new file mode 100644
index 00000000..236bcf77
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/PersonDataAbility.java
@@ -0,0 +1,134 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.Ability;
+import ohos.aafwk.ability.DataAbilityHelper;
+import ohos.aafwk.content.Intent;
+import ohos.data.DatabaseHelper;
+import ohos.data.dataability.DataAbilityUtils;
+import ohos.data.rdb.*;
+import ohos.data.resultset.ResultSet;
+import ohos.data.dataability.DataAbilityPredicates;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.utils.net.Uri;
+import ohos.utils.PacMap;
+
+import java.io.FileDescriptor;
+
+public class PersonDataAbility extends Ability {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "PersonDataAbility");
+
+ private static final String DB_NAME = "persondataability.db";
+
+ private static final String DB_TAB_NAME = "person";
+
+ private static final String DB_COLUMN_PERSON_ID = "id";
+
+ private static final String DB_COLUMN_FIRSTNAME = "first_name";
+
+ private static final String DB_COLUMN_LASTNAME = "last_name";
+
+ private static final String DB_COLUMN_GENDER = "gender";
+
+ private static final String DB_COLUMN_EMAIL = "email";
+
+ private static final String DB_COLUMN_PASSWORD = "password";
+
+ private static final String DB_COLUMN_PHONE = "phone";
+
+ private static final int DB_VERSION = 1;
+
+ private final StoreConfig config = StoreConfig.newDefaultConfig(DB_NAME);
+
+ private RdbStore rdbStore;
+
+ private final RdbOpenCallback rdbOpenCallback = new RdbOpenCallback() {
+ @Override
+ public void onCreate(RdbStore store) {
+ store.executeSql("create table if not exists "
+ + DB_TAB_NAME + " ("
+ + DB_COLUMN_PERSON_ID + " integer primary key autoincrement, "
+ + DB_COLUMN_FIRSTNAME + " text not null, "
+ + DB_COLUMN_LASTNAME + " text not null, "
+ + DB_COLUMN_GENDER + " text not null, "
+ + DB_COLUMN_EMAIL + " text not null, "
+ + DB_COLUMN_PHONE + " text not null, "
+ + DB_COLUMN_PASSWORD + " text not null)");
+ }
+
+ @Override
+ public void onUpgrade(RdbStore store, int oldVersion, int newVersion) {
+ }
+ };
+
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ HiLog.info(LABEL_LOG, "PersonDataAbility onStart");
+
+ DatabaseHelper databaseHelper = new DatabaseHelper(this);
+ rdbStore = databaseHelper.getRdbStore(config, DB_VERSION, rdbOpenCallback, null);
+ }
+
+ @Override
+ public ResultSet query(Uri uri, String[] columns, DataAbilityPredicates predicates) {
+ RdbPredicates rdbPredicates = DataAbilityUtils.createRdbPredicates(predicates, DB_TAB_NAME);
+ ResultSet resultSet = rdbStore.query(rdbPredicates, columns);
+ if (resultSet == null) {
+ HiLog.info(LABEL_LOG, "resultSet is null");
+ }
+ return resultSet;
+ }
+
+ @Override
+ public int insert(Uri uri, ValuesBucket value) {
+ HiLog.info(LABEL_LOG, "PersonDataAbility insert");
+ String path = uri.getLastPath();
+ if (!"person".equals(path)) {
+ HiLog.info(LABEL_LOG, "DataAbility insert path is not matched");
+ return -1;
+ }
+ ValuesBucket values = new ValuesBucket();
+ values.putInteger(DB_COLUMN_PERSON_ID, value.getInteger(DB_COLUMN_PERSON_ID));
+ values.putString(DB_COLUMN_FIRSTNAME, value.getString(DB_COLUMN_FIRSTNAME));
+ values.putString(DB_COLUMN_LASTNAME, value.getString(DB_COLUMN_LASTNAME));
+ values.putString(DB_COLUMN_GENDER, value.getString(DB_COLUMN_GENDER));
+ values.putString(DB_COLUMN_EMAIL, value.getString(DB_COLUMN_EMAIL));
+ values.putString(DB_COLUMN_PHONE, value.getString(DB_COLUMN_PHONE));
+ values.putString(DB_COLUMN_PASSWORD, value.getString(DB_COLUMN_PASSWORD));
+
+ int index = (int) rdbStore.insert(DB_TAB_NAME, values);
+ DataAbilityHelper.creator(this, uri).notifyChange(uri);
+ return index;
+ }
+
+ @Override
+ public int delete(Uri uri, DataAbilityPredicates predicates) {
+ return 0;
+ }
+
+ @Override
+ public int update(Uri uri, ValuesBucket value, DataAbilityPredicates predicates) {
+ return 0;
+ }
+
+ @Override
+ public FileDescriptor openFile(Uri uri, String mode) {
+ return null;
+ }
+
+ @Override
+ public String[] getFileTypes(Uri uri, String mimeTypeFilter) {
+ return new String[0];
+ }
+
+ @Override
+ public PacMap call(String method, String arg, PacMap extras) {
+ return null;
+ }
+
+ @Override
+ public String getType(Uri uri) {
+ return null;
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
new file mode 100644
index 00000000..15462d4a
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSlice.java
@@ -0,0 +1,82 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.Text;
+import ohos.agp.components.TextField;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+import ohos.data.dataability.DataAbilityPredicates;
+import com.example.trainingapp.DbUtils;
+import ohos.data.resultset.ResultSet;
+import ohos.agp.window.dialog.ToastDialog;
+
+public class LoginSlice extends AbilitySlice {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "LoginSlice");
+
+ TextField email, password;
+ Text loginError;
+ Button loginBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login);
+
+ String email_intent = intent.getStringParam("email");
+ String password_intent = intent.getStringParam("password");
+
+ email = (TextField) findComponentById(ResourceTable.Id_emailLogin);
+ password = (TextField) findComponentById(ResourceTable.Id_passwordLogin);
+ loginError = (Text) findComponentById(ResourceTable.Id_loginError);
+ loginBtn = (Button) findComponentById(ResourceTable.Id_loginButton);
+
+ if (email_intent != null) {
+ email.setText(email_intent);
+ }
+
+ if (password_intent != null) {
+ password.setText(password_intent);
+ }
+
+ loginBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ validateUser();
+ }
+ });
+ }
+
+ private void validateUser() {
+ loginError.setText(null);
+ DataAbilityPredicates predicates = new DataAbilityPredicates();
+ predicates.equalTo(DbUtils.DB_COLUMN_EMAIL, email.getText());
+ predicates.equalTo(DbUtils.DB_COLUMN_PASSWORD, password.getText());
+
+ ResultSet resultSet = DbUtils.query(this, predicates);
+ if(resultSet == null || resultSet.getRowCount()==0) {
+ HiLog.error(LABEL_LOG, "resultset empty || getrowcount = 0");
+ loginError.setVisibility(Component.VISIBLE);
+ new ToastDialog(getContext())
+ .setText("Invalid username/password")
+ .show();
+ return;
+ }
+
+ resultSet.goToFirstRow();
+ int id = resultSet.getInt(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_PERSON_ID));
+ String name = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_FIRSTNAME));
+ String email = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_EMAIL));
+ String gender = resultSet.getString(resultSet.getColumnIndexForName(DbUtils.DB_COLUMN_GENDER));
+ HiLog.info(LABEL_LOG, "query: Id :" + id + " Name :" + name + " Gender :" + gender + " Email :" + email);
+
+ new ToastDialog(getContext())
+ .setText("Login Successful")
+ .show();
+
+ present(new LoginSuccessSlice(), new Intent());
+
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java
new file mode 100644
index 00000000..c50ce89e
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/LoginSuccessSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class LoginSuccessSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_login_success);
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
new file mode 100644
index 00000000..8527312d
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/MainAbilitySlice.java
@@ -0,0 +1,49 @@
+package com.example.trainingapp.slice;
+
+import com.example.trainingapp.ResourceTable;
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import ohos.agp.animation.AnimatorProperty;
+import ohos.agp.components.Button;
+import ohos.agp.components.Component;
+import ohos.agp.components.Image;
+
+public class MainAbilitySlice extends AbilitySlice {
+ @Override
+ public void onStart(Intent intent) {
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_ability_main);
+
+ Button bt1 = (Button) findComponentById(ResourceTable.Id_log);
+ Button bt2 = (Button) findComponentById(ResourceTable.Id_sign);
+
+ Image img = (Image) findComponentById(ResourceTable.Id_icon);
+ AnimatorProperty animatorProperty = img.createAnimatorProperty();
+ animatorProperty.moveFromX(50).moveToX(50).rotate(180).alpha(0).setDuration(2500).setDelay(500).setLoopedCount(-1);
+
+ img.setBindStateChangedListener(new Component.BindStateChangedListener() {
+ @Override
+ public void onComponentBoundToWindow(Component component) {
+ animatorProperty.start();
+ }
+
+ @Override
+ public void onComponentUnboundFromWindow(Component component) {
+ animatorProperty.stop();
+ }
+ });
+
+ bt1.setClickedListener(listener -> present(new LoginSlice(), new Intent()));
+ bt2.setClickedListener(listener -> present(new SignupSlice(), new Intent()));
+ }
+
+ @Override
+ public void onActive() {
+ super.onActive();
+ }
+
+ @Override
+ public void onForeground(Intent intent) {
+ super.onForeground(intent);
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
new file mode 100644
index 00000000..43430a22
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSlice.java
@@ -0,0 +1,165 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import com.example.trainingapp.DbUtils;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+import ohos.agp.components.*;
+import java.util.regex.Pattern;
+
+import ohos.agp.window.dialog.CommonDialog;
+import ohos.agp.window.dialog.IDialog;
+import ohos.agp.window.dialog.ToastDialog;
+import ohos.hiviewdfx.HiLog;
+import ohos.hiviewdfx.HiLogLabel;
+
+import static ohos.agp.components.ComponentContainer.LayoutConfig.MATCH_CONTENT;
+
+public class SignupSlice extends AbilitySlice {
+ private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "SignupSlice");
+ TextField firstName, lastName, email, password, mobile;
+ Text firstError, lastError, emailError, passError, mobileError, radioError;
+ RadioButton maleRadio,femaleRadio;
+ Button signupBtn;
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup);
+
+
+ firstName = (TextField) findComponentById(ResourceTable.Id_first_name);
+ lastName = (TextField) findComponentById((ResourceTable.Id_last_name));
+ email = (TextField) findComponentById(ResourceTable.Id_email);
+ password = (TextField) findComponentById(ResourceTable.Id_password);
+ mobile = (TextField) findComponentById(ResourceTable.Id_phone);
+
+ maleRadio = (RadioButton) findComponentById(ResourceTable.Id_male);
+ femaleRadio = (RadioButton) findComponentById(ResourceTable.Id_female);
+
+ firstError = (Text) findComponentById(ResourceTable.Id_firstError);
+ lastError = (Text) findComponentById(ResourceTable.Id_lastError);
+ emailError = (Text) findComponentById(ResourceTable.Id_emailError);
+ passError = (Text) findComponentById(ResourceTable.Id_passwordError);
+ mobileError = (Text) findComponentById(ResourceTable.Id_phoneError);
+ radioError = (Text) findComponentById(ResourceTable.Id_radioError);
+
+ signupBtn =(Button) findComponentById(ResourceTable.Id_signup);
+
+ signupBtn.setClickedListener(new Component.ClickedListener() {
+ @Override
+ public void onClick(Component component) {
+ if(checkValidity() == true){
+ String gender;
+ if(maleRadio.isChecked()) gender = "Male";
+ else gender = "Female";
+ DbUtils.insert(SignupSlice.this, firstName.getText(), lastName.getText(), gender, email.getText(), mobile.getText(), password.getText());
+ HiLog.info(LABEL_LOG, "User registered");
+ DbUtils.showDB(SignupSlice.this);
+
+ CommonDialog commonDialog = new CommonDialog(SignupSlice.this);
+ commonDialog.setTitleText("Common Dialog");
+ commonDialog.setContentText("Login now?");
+ commonDialog.setAutoClosable(true);
+ commonDialog.setSize(1000, MATCH_CONTENT);
+ commonDialog.setButton(IDialog.BUTTON1, "Yes", (iDialog, i) -> {
+ Intent intent1 = new Intent();
+ intent1.setParam("email", email.getText());
+ intent1.setParam("password", password.getText());
+ present(new LoginSlice(), intent1);
+ iDialog.destroy();
+ });
+ commonDialog.setButton(IDialog.BUTTON2, "No", (iDialog, i) -> {
+ present(new SignupSuccessSlice(), new Intent());
+ iDialog.destroy();
+ });
+ commonDialog.show();
+ }
+ else {
+ new ToastDialog(getContext())
+ .setText("Invalid parameters")
+ .show();
+
+
+ }
+ }
+ });
+
+ }
+ public boolean isNameValid(TextField name){
+ String str = name.getText();
+ String regex = "[a-zA-Z]+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isEmailValid(TextField email){
+ String str = email.getText();
+ String regex = ".+@.+\\..+";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPhoneValid(TextField mobile){
+ String str = mobile.getText();
+ String regex = "[1-9][0-9]{9}";
+ Pattern p = Pattern.compile(regex);
+
+ return p.matcher(str).matches();
+ }
+
+ public boolean isPassValid(TextField password){
+ String str = password.getText();
+ String regex = ".{5,}";
+ Pattern p = Pattern.compile(regex);
+ return p.matcher(str).matches();
+ }
+
+ public boolean checkValidity(){
+ boolean b = true;
+ if(firstName.getText() == null || firstName.getText().isEmpty() || !isNameValid(firstName)){
+ firstError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ firstError.setVisibility(Component.INVISIBLE);
+ }
+ if(lastName.getText() == null || lastName.getText().isEmpty() || !isNameValid(lastName)){
+ lastError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ lastError.setVisibility(Component.INVISIBLE);
+ }
+ if(email.getText() == null || email.getText().isEmpty() || !isEmailValid(email)){
+ emailError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ emailError.setVisibility(Component.INVISIBLE);
+ }
+ if(mobile.getText() == null || mobile.getText().isEmpty() || !isPhoneValid(mobile)){
+ mobileError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ mobileError.setVisibility(Component.INVISIBLE);
+ }
+ if(password.getText() == null || password.getText().isEmpty() || !isPassValid(password)){
+ passError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ passError.setVisibility(Component.INVISIBLE);
+ }
+ if(!maleRadio.isChecked() && !femaleRadio.isChecked()){
+ radioError.setVisibility(Component.VISIBLE);
+ b = false;
+ }
+ else{
+ radioError.setVisibility(Component.INVISIBLE);
+ }
+ return b;
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java
new file mode 100644
index 00000000..93414cbe
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/java/com/example/trainingapp/slice/SignupSuccessSlice.java
@@ -0,0 +1,13 @@
+package com.example.trainingapp.slice;
+
+import ohos.aafwk.ability.AbilitySlice;
+import ohos.aafwk.content.Intent;
+import com.example.trainingapp.ResourceTable;
+
+public class SignupSuccessSlice extends AbilitySlice {
+ @Override
+ protected void onStart(Intent intent){
+ super.onStart(intent);
+ super.setUIContent(ResourceTable.Layout_signup_success);
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/element/string.json b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
new file mode 100644
index 00000000..fb02a338
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "trainingApp"
+ },
+ {
+ "name": "mainability_description",
+ "value": "Java_Phone_Empty Feature Ability"
+ },
+ {
+ "name": "mainability_HelloWorld",
+ "value": "Hello World"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
new file mode 100644
index 00000000..c0c0a3df
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/graphic/background_ability_main.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
new file mode 100644
index 00000000..13cf948e
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/ability_main.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
new file mode 100644
index 00000000..f9fe34fb
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/login.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml
new file mode 100644
index 00000000..11d27d8a
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/login_success.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
new file mode 100644
index 00000000..9b0527a0
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/signup.xml
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml
new file mode 100644
index 00000000..a362048b
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/layout/signup_success.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 00000000..ce307a88
Binary files /dev/null and b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/main/resources/base/media/icon.png differ
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/ohosTest/config.json b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/ohosTest/config.json
new file mode 100644
index 00000000..0e29531e
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/ohosTest/config.json
@@ -0,0 +1,41 @@
+{
+ "app": {
+ "bundleName": "com.example.trainingapp",
+ "vendor": "example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Release"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.trainingapp",
+ "name": "testModule",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry_test",
+ "moduleType": "feature",
+ "installationFree": true
+ },
+ "abilities": [
+ {
+ "name": "decc.testkit.runner.EntryAbility",
+ "description": "Test Entry Ability",
+ "icon": "$media:icon",
+ "label": "$string:app_name",
+ "launchType": "standard",
+ "orientation": "landscape",
+ "visible": true,
+ "type": "page"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
new file mode 100644
index 00000000..3340a0d6
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/ohosTest/java/com/example/trainingapp/ExampleOhosTest.java
@@ -0,0 +1,14 @@
+package com.example.trainingapp;
+
+import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleOhosTest {
+ @Test
+ public void testBundleName() {
+ final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
+ assertEquals("com.example.trainingapp", actualBundleName);
+ }
+}
\ No newline at end of file
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
new file mode 100644
index 00000000..b047cceb
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/entry/src/test/java/com/example/trainingapp/ExampleTest.java
@@ -0,0 +1,9 @@
+package com.example.trainingapp;
+
+import org.junit.Test;
+
+public class ExampleTest {
+ @Test
+ public void onStart() {
+ }
+}
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/gradle.properties b/HarmonyOS/Day5 Assingment/trainingApp/gradle.properties
new file mode 100644
index 00000000..0daf1830
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/gradle.properties
@@ -0,0 +1,10 @@
+# Project-wide Gradle settings.
+# IDE (e.g. DevEco Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# If the Chinese output is garbled, please configure the following parameter.
+# org.gradle.jvmargs=-Dfile.encoding=GBK
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar b/HarmonyOS/Day5 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..490fda85
Binary files /dev/null and b/HarmonyOS/Day5 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties b/HarmonyOS/Day5 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..f59159e8
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/gradlew b/HarmonyOS/Day5 Assingment/trainingApp/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/gradlew.bat b/HarmonyOS/Day5 Assingment/trainingApp/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/HarmonyOS/Day5 Assingment/trainingApp/settings.gradle b/HarmonyOS/Day5 Assingment/trainingApp/settings.gradle
new file mode 100644
index 00000000..4773db73
--- /dev/null
+++ b/HarmonyOS/Day5 Assingment/trainingApp/settings.gradle
@@ -0,0 +1 @@
+include ':entry'