-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d0a090
commit 8632c74
Showing
179 changed files
with
26,732 additions
and
2,570 deletions.
There are no files selected for viewing
449 changes: 449 additions & 0 deletions
449
Android_Development_With_Java/02.16 Migrate from ViewPager to ViewPager2.md
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
Android_Development_With_Java/1 Introduction/1.12 Dalvik-Virtual-Machine.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Android-Java: 1.12 Dalvik-Virtual-Machine | ||
|
||
|
||
| <div width="70%">As you all know the JVM is high performance and provides excellent memory management. But it needs to be optimized for low-powered handheld devices as well. This is the reason why Dalvik Virtual Machine (DVM) was introduced.</div> | ![image](https://user-images.githubusercontent.com/70523057/135160506-fb22c6a7-a7a7-4afd-a823-64590c8eb850.png)| | ||
|:-|:-| | ||
|
||
### Introduction to DVM: | ||
Dalvik Virtual Machine is a Register-Based virtual machine for executing Android apps. | ||
DVM is an android virtual machine optimized for mobile devices. | ||
It optimizes the virtual machine for memory, battery life and performance. | ||
The **_DVM design principle_** aims to optimize itself so that it can `load fastly` and `run smoothly` even on low memory/powered devices. | ||
|
||
### Working of DVM: | ||
> Steps - | ||
1. The Java Compiler`(javac)` converts the Java Source Code`(.java)` into Java Byte-Code`(.class)`. | ||
2. Then DEX Compiler`(dx tool)` converts all this `(.class)` file of the application into a single Dalvik Byte Code i.e. `"dex"` file. | ||
3. The Android Assets Packaging Tool `(aapt)` handles the packaging process and later it forms a `".apk"` file. | ||
|
||
> Look over the diagram to understand the process- | ||
<div align="center"><img src="https://user-images.githubusercontent.com/70523057/135159025-2ed2c1e2-82d8-44a3-9e5b-d976564298b2.png" width="600"></div> | ||
<div align="center"><table><tr> | ||
<td><img src="https://user-images.githubusercontent.com/70523057/135160718-814b781d-0ebd-45bb-a440-977c33e9b656.png" width="400"></td> | ||
<td><img src="https://user-images.githubusercontent.com/70523057/135160795-ca187c6f-f349-44b5-88cb-a965472ef879.png" width="400"></td> | ||
</tr></table></div> | ||
|
||
<br><br> | ||
|
||
### Advantages: | ||
- DVM supports the Android operating system only. | ||
- Execution is faster because it treats the variable and object of the same name as one. | ||
- From Android 2.2 SDK Dalvik has it’s own JIT (Just In Time) compiler. | ||
- In DVM, the executable is an APK file. | ||
- DVM has been designed so that a device can run multiple instances of the Virtual Machine effectively. | ||
- Every application is given their own instance. | ||
|
||
> Though it has these merits,but it still has some drawbacks. Here, few disadvantages are listed. | ||
### Disadvantages: | ||
- DVM supports only Android Operating System. | ||
- For DVM very few Re-Tools are available. | ||
- Requires more instructions than register machines to implement the same high-level code. | ||
- App Installation takes more time due to dex. | ||
- More internal storage is required. | ||
|
||
### Application: | ||
For Android, a new Virtual machine was developed by Google as stated above. | ||
It uses registers of the CPU to store the operands. So no requirement of any pushing and popping of instructions. Hence making execution faster. | ||
The instructions operate on virtual registers, being those virtual registers memory positions in the host device. Register-based models are good at optimizing and running on low memory. They can store common sub-expression results which can be used again in the future. This is not possible in a Stack-based model at all. | ||
Dalvik Virtual Machine uses its own byte-code and runs “.dex”(Dalvik Executable File) file. | ||
|
||
### References: | ||
- [origin of DVM](https://www.javatpoint.com/dalvik-virtual-machine) | ||
- [Difference between DVM and JVM](https://www.geeksforgeeks.org/difference-between-jvm-and-dvm/) |
142 changes: 142 additions & 0 deletions
142
Android_Development_With_Java/1 Introduction/1.3 Installing Android studio.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 2, | ||
"metadata": { | ||
"colab": { | ||
"name": "java_INSTALLATION.ipynb", | ||
"provenance": [], | ||
"collapsed_sections": [] | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
}, | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#<B>Installing Android Studio</B>\r\n", | ||
"\r\n", | ||
"Download Android studio to here: https://developer.android.com/studio#downloads\r\n", | ||
"as per your operating system.\r\n", | ||
"here <b>.exe</b> and <b>.zip</b> both are available. <br>\r\n", | ||
"If you download <b>.zip</b> then unzip it (using write click on those file and select option \"extrect here\").\r\n", | ||
"open android-studio > bin folder here 2 <b>.exe</b> file presant. studio64.exe (for 64-bit machine) and studio.exe (for 32-bit machine).\r\n", | ||
"\r\n", | ||
"#Installation Android studio in system. \r\n", | ||
"\r\n", | ||
"1. For windows user:-<br>\r\n", | ||
"\r\n", | ||
" 1. launch Android studio --> click on <b>.exe</b> file.<br> then you find this interface.\r\n", | ||
" ![Picture](https://drive.google.com/uc?export=view&id=1V9_6th_5Q67M43Ole9N-m32ht8Foz6HG)\r\n", | ||
"\r\n", | ||
" 2. continue with next.\r\n", | ||
"\r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1VSBvcf4gEGz3FWliaFFGbt54jko4W-QZ)\r\n", | ||
" \r\n", | ||
" 3. Click next\r\n", | ||
" \r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1pouggp9DMpjDAbdAUIaImi-4oqRT6ReJ)\r\n", | ||
" \r\n", | ||
" 4. choose path and click next.\r\n", | ||
" \r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1bXowczn9w2DPswfqi71xxzy6etjGXa6Z)\r\n", | ||
"\r\n", | ||
" 5. Click Install\r\n", | ||
" \r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1HQaR5BMICir03wP0s6ms6L4yCeKW1tB5)\r\n", | ||
" \r\n", | ||
" 6. Installing start\r\n", | ||
" \r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1yUbhWF8aHtq6lkRpA6i83gZOh46iCAeC)\r\n", | ||
" \r\n", | ||
" 7. Click next\r\n", | ||
" \r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1zaVnwt3NSgBJVY1xC41YoYS7Qj91ZPdQ)\r\n", | ||
" \r\n", | ||
" 8. Click finish\r\n", | ||
" \r\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=11iyo3ViJclYnkyY8V16NGKywMoDul7hH)\r\n", | ||
"\r\n" | ||
], | ||
"metadata": { | ||
"id": "zX-h1IcZU6-J" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"2. For MAC user :-<br>\n", | ||
" \n", | ||
" 1. Launch the Android Studio DMG file.(double click on DMG file)\n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1EWVePbCO_Q2Zoa2XLvq-WH677jwVZqvc)\n", | ||
"\n", | ||
" 2. Drag and drop Android Studio into the Applications folder, then launch Android Studio.\n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1G_IEm3vnl2RThYMRmVIHqxubNSAs7qR4)\n", | ||
"\n", | ||
" 3. click OK.\n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1vZHEP1ZCosI1-JoWA-AVbHX-8IrfPkdo)\n", | ||
"\n", | ||
" 4. click next.\n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1fR7m3-MWp2cZm8xjQVfor6trjaiUAWvR)\n", | ||
"\n", | ||
" 5. click next.\n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1e6Y3r_MYQHnCRUIwBZhX8C4QIi9aj9kH).\n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1yxf2IPAZQE9isZwF2e2Jq2B2M7BPWVzK)\n", | ||
". \n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1hYCEk0O_X65qdhymNMO1s9X6GPOyAXaN)\n", | ||
" .\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1DyrVCemBeJicj-oZRKxdg5IuNaaQ_vLI)\n", | ||
".\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1wmQhug-o_3fXmxzNqlQS-29-CrKY3idU)\n" | ||
], | ||
"metadata": { | ||
"id": "Pn7BbBURI8kM" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"3.For Linux user: <br>\n", | ||
"\n", | ||
" 1. unzip file using this command\n", | ||
" \"tar –xvzf android-studio-2020.3.1.24-linux.tar.gz\"\n", | ||
" 2. Go in (/Downloads/android-studio/bin) this directory\n", | ||
" 3. Run \"./android.sh\" then start android-studio ..\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1uxqSae0b5TrSGrlANvUQYqJuTV7mvqDx) \n", | ||
" \n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1lkmsa-G0cr07pNLZhwnn9uCTZzb_fFMj) \n", | ||
" \n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1ftJkNL2h9nSDA5dW5lMUwRoE4Emn_TaB) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1SWfVtcuod-wJJ0jZ6gAaMeyMgxb7tAaH) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1E72XZ_SA4GJtiGnaJSICBTksaex7LRcQ) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1qprqRLtjqfLYn0eGCotWxud2Svb0Qoxw) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=12YQ8wPHTUPumVr9Ac9iqJAWakqd1OgTz) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1wDGX2eIiIU_tyBReCIxCFteY4wUstL90) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=14pf1QnCb7QkUOPnEGDZiAbyumyZL1-4N) \n", | ||
"\n", | ||
" ![picture](https://drive.google.com/uc?export=view&id=1z3jJy5QMfLpOLtWyO3EezCgriyF3asqT) \n", | ||
"\n" | ||
], | ||
"metadata": { | ||
"id": "4dQZpz2_J3dG" | ||
} | ||
} | ||
] | ||
} |
63 changes: 63 additions & 0 deletions
63
Android_Development_With_Java/1 Introduction/1.3.1 Customize Android Studio UI.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
## Customize Android Studio UI | ||
|
||
**So if you have installed the latest version of `Android Studio Arctic Fox` (at the time of writing) you should have a UI that looks something like this.** | ||
|
||
![1](https://user-images.githubusercontent.com/51878265/139712602-52e10627-0932-4eba-b132-db2cb7f2cafa.png) | ||
|
||
> ## First - we will look at default options to customize Android Studio. | ||
Go into `Files-> Settings` or use shortcut `Ctrl+Alt+s`. After that, a pop-up box will open with the setting tab. | ||
|
||
![2](https://user-images.githubusercontent.com/51878265/139713821-3d1fc36c-de43-4486-9ca8-2981300828bf.png) | ||
|
||
* ### We can use Custom `Font` and `Size`, according to our preference. | ||
|
||
<p align="center"><img src ="https://user-images.githubusercontent.com/51878265/139714574-ac9f2ca3-3fb1-44ac-bfd0-85aad256a33b.png"></p> | ||
|
||
**Preview:** | ||
|
||
![Screenshot 2021-11-01 230844](https://user-images.githubusercontent.com/51878265/139715324-bc0db592-6146-4f37-83c5-1a23ad75aedb.png) | ||
|
||
* ### We can also customize the theme. | ||
|
||
<p align="center"><img src ="https://user-images.githubusercontent.com/51878265/139716160-42a9f844-7bd3-4bfa-bd80-d6edc926d865.png"></p> | ||
|
||
**Preview:** | ||
|
||
> Intellij Light | ||
![Screenshot 2021-11-01 231320](https://user-images.githubusercontent.com/51878265/139716379-7dda6b03-7605-42e4-8f85-82656c0a5945.png) | ||
|
||
> High Contrast | ||
![Screenshot 2021-11-01 231351](https://user-images.githubusercontent.com/51878265/139716392-3ecd88a1-ab20-400e-bf31-e670df2f28d1.png) | ||
|
||
* ### We can also add our custom background. | ||
|
||
![Screenshot 2021-11-01 232818](https://user-images.githubusercontent.com/51878265/139718352-aacf81fa-433a-4568-805b-f347dfec27c0.png) | ||
|
||
**Preview:** | ||
|
||
![Screenshot 2021-11-01 232931](https://user-images.githubusercontent.com/51878265/139718357-f24e8aa6-1ea7-4989-aefb-83605124609f.png) | ||
|
||
> ## Second - By installing the Plugin | ||
Go to `File -> Settings -> Plugins` and install **Material Theme UI Plugin**. | ||
|
||
![Screenshot 2021-11-02 224125](https://user-images.githubusercontent.com/51878265/139913211-bad5d4c9-4d54-4981-9d66-16cdab18e860.png) | ||
|
||
### After installation, Restart your Android Studio. After Restart your Environment will look like this. | ||
|
||
![Screenshot 2021-11-02 225445](https://user-images.githubusercontent.com/51878265/139914903-71a93a23-6258-4871-b3d2-846e08a09838.png) | ||
|
||
### Material Theme consists, lots of Theme, Accent, and Pannel color. | ||
|
||
**For that you need `Tools -> Material Theme`** | ||
|
||
![Screenshot 2021-11-02 225700](https://user-images.githubusercontent.com/51878265/139916254-147de483-6b34-481c-889f-0957eb8b4c9d.png) | ||
|
||
### We can also customize icons. | ||
|
||
![Screenshot 2021-11-02 230625](https://user-images.githubusercontent.com/51878265/139916856-1cd41cce-3673-4e56-81c7-85ede2562b67.png) | ||
|
||
|
68 changes: 68 additions & 0 deletions
68
Android_Development_With_Java/1 Introduction/1.4 Creating First Project.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 1.4 Creating First Project | ||
|
||
In this tutorial, we'll see creating the first project in Android studio. This tutorial is for absolute beginners in Android development. | ||
|
||
+ First of all click on the "Create New Project". | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/134822022-3fb3d3dd-5b33-4ba2-9470-af01ad472d8d.png) | ||
|
||
|
||
+ Now select the desired predefined Activity Templates based on your requirements, because we are simply creating an app so select "Empty Activity" and click "Next". If you want to work on Maps then select Google Map Activity. | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/135332697-805d3fb6-d3f0-4486-9241-417b602c08df.png) | ||
|
||
|
||
+ You can also select Activity Templates based on devices like for Phones, Tabs, Wear OS, Android TV, Automotive and any other Android things. | ||
+ Activity Templates for Wear OS | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/135334018-33344721-5fc9-4654-bee9-cd6cb0a62c92.png) | ||
|
||
+ Activity Templates for Android TV | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/135334579-0c85ab82-df71-46fc-8733-9348506d7b84.png) | ||
|
||
|
||
+ Activity Templates for Automotive | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/135334908-cdf2bc30-6504-456b-8bfa-778c339c314e.png) | ||
|
||
+ Activity Templates for other Android Things | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/135335069-14b8268f-7bc4-490e-a2b9-8d271592e4fa.png) | ||
<br> | ||
<br> | ||
|
||
|
||
+ <h3>Configure the Project</h3> | ||
After selecting the activity, now next step is to configure the some settings as described below.<br> | ||
|
||
![image](https://user-images.githubusercontent.com/42228297/135341669-79ebd5c0-8bee-4d9b-93e1-8c04310aaa61.png) | ||
|
||
|
||
1. Specify the "Name" of the project. <br> | ||
2. Specify the "Package name". By default, this package name also becomes your application ID, which you can change later. <br> | ||
3. Specify the "Save location" where you want to locally store your project. <br> | ||
4. Select the Language you want Android Studio to use when creating sample code for your new project. As we are creating Java Application select "Java". Keep in mind, you are not limited to using only that language creating the project. <br> | ||
5. Select the "Minimum API level" you want your app to support. When you select a lower API level, your app can rely on fewer modern Android APIs. However, a larger percentage of Android devices are able to run your app. The opposite is true when selecting a higher API level. If you want to see more data to help you decide, click "Help me choose". | ||
6. If you want your project to use "AndroidX libraries" by default, which are improved replacements of the Android Support libraries, check the box next to Use AndroidX artifacts. <br> | ||
When you're finish all the configuration settings to create your project, click "Finish". <br> | ||
|
||
|
||
Android Studio creates your new project with some basic code and resources to get you started. If you later decide to add support for a different device form factor, you can add a module to your project later. And if you want to share code and resources between modules, you can do so by creating an Android library. <br><br> | ||
|
||
|
||
+ <h3>Import an existing project</h3> | ||
To import an existing, local project into Android Studio, proceed as follows:<br> | ||
1. Click "File > New > Import Project". <br> | ||
2. In the window that appears, navigate to the root directory of the project you want to import. <br> | ||
3. Click "OK". <br> | ||
Android Studio then opens the project in a new IDE window and indexes its contents. <br><br> | ||
|
||
<hr> | ||
For more Detail information about Creating the Project, see the Android Developer documentation on https://developer.android.com/studio/projects/create-project . | ||
<br> | ||
<br> | ||
Was this Documentation helpful? If, yes give a star to this Repository. | ||
|
||
### Authors | ||
- [Sai Kumar](https://github.com/saigoud25) |
51 changes: 51 additions & 0 deletions
51
...elopment_With_Java/1 Introduction/1.5 Running your app using virtual device.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Run your app on Real Device | ||
|
||
+ Go to Mobile settings and open Developer Options Window. If you can’t see the developer option then go step no 2. Else step no 3. | ||
+ Open **About Phone** Window then go Software Information after open, tap 7 times on **Build Number**. (You can go according to your device's setting may be **About Phone** in a different window.) | ||
|
||
<br> | ||
<p align="center"> | ||
<img src="https://user-images.githubusercontent.com/65021072/133723833-8f89541d-fdf5-42cc-a811-9348065a5fbf.jpg" | ||
style="width:30%; | ||
height:30% | ||
display: block; | ||
" /> | ||
</p> | ||
<br> | ||
|
||
+ After Enable Developer options you can see one option that is **USB debugging** you need to enable this option. (Take care by mistake of any other option not enable or disable.) | ||
|
||
<br> | ||
<p align="center"> | ||
<img src="https://user-images.githubusercontent.com/65021072/133723840-38dcbad2-d9ff-48c6-84a5-2639f8e0776e.jpg" | ||
style="width:30%; | ||
height:30% | ||
display: block; | ||
" /> | ||
</p> | ||
<br> | ||
|
||
+ Mobile set up is completed now, Connect your device to your development machine with a **USB cable**. | ||
+ Open Android Studio IDE you can see at the top your device model name. | ||
+ Now Just Click on the Run button. (Android Studio automatically install an app into your Mobile and you can see the output.) | ||
|
||
|
||
# Run apps on the Android Emulator | ||
|
||
+ Before Creating Android Emulator first check your device requirements [here](https://developer.android.com/studio/run/emulator?authuser=2#requirements). | ||
+ Click on **Tools** and go to **AVD Manager** then Create Virtual Device… | ||
+ Then Select Virtual Device according to your choice, then go next and Download the android version which you want. | ||
+ You can create a **custom virtual device** based on your requirements. | ||
|
||
<br> | ||
<p align="center"> | ||
<img src="https://user-images.githubusercontent.com/65021072/133725835-dbd0b2de-ed38-46a0-af4c-00f46f0cfaae.png" | ||
style="width:50%; | ||
height:50% | ||
display: block; | ||
" /> | ||
</p> | ||
<br> | ||
|
||
+ After Download Completed select your virtual device for Run. | ||
+ Now Just Click on the Run button. (Android Studio automatically install an app into your Virtual device and you can see the output.) |
Oops, something went wrong.