Android

From Hidden Wiki
Jump to navigation Jump to search
Unix Assembly language Mathematics Web development I2P
GhostBSD Assembly Programming Tutorial Statistics Django for Beginners MuWire
GUI Artificial intelligence Artificial neural network Machine learning Messenger
Tkinter Artificial intelligence Artificial neural network Machine Learning Mastery with Python Session

Android is one of Linux distributions.


On 7 May 2019, Google announced that the Kotlin programming language is now its preferred language for Android app developers. Since the release of Android Studio 3.0 in October 2017, Kotlin has been included as an alternative to the standard Java compiler. The Android Kotlin compiler targets Java 6 by default, but lets the programmer choose between Java 8 to 13, for optimization.

Full-disk encryption vs. File-based encryption

Devices running Android 7.0–9 support full-disk encryption. New devices running Android 10 and higher must use file-based encryption.

https://source.android.google.cn/security/encryption/full-disk


Android 7.0 and higher supports file-based encryption (FBE). File-based encryption allows different files to be encrypted with different keys that can be unlocked independently.

This article describes how to enable file-based encryption on new devices and how system applications can use the Direct Boot APIs to offer users the best, most secure experience possible.


Direct Boot

File-based encryption enables a new feature introduced in Android 7.0 called Direct Boot. Direct Boot allows encrypted devices to boot straight to the lock screen. Previously, on encrypted devices using full-disk encryption (FDE), users needed to provide credentials before any data could be accessed, preventing the phone from performing all but the most basic of operations.

https://source.android.google.cn/security/encryption/file-based


Full-disk encryption (FDE) is more secure than file-based encryption (FBE).

Java vs. Kotlin: which language to learn?

Ever since Google announced Kotlin as the official language for Android development at Google IO in 2017, programmers who want to become Android developers have a dilemma. The big question in front of them is whether they should learn Kotlin or Java.

Beginners in Android Development Should Start With Java

The first and foremost thing is that Android development is not everything. As a programmer, you may be starting your career with Android development. But if you start with a well-established language like Java, you become a part of the bigger Java community and market, which directly means more job opportunities.

The second and more important thing is that there is a huge community of Java programmers, which means you can find answers when you are stuck. This is very important because, as a beginner, you will face a lot of technical problems and you might not know where to head when you are stuck.

When you search Google with a Java problem, you are bound to get answers. But the same cannot be said for Kotlin, which is still a new programming language.

How to Install Android Studio

How to Install Android Studio on Ubuntu 20.04


Install desired Java version. For example in this case we will go with Java openjdk-11-jdk:

$ sudo apt install openjdk-11-jdk


Next, open a terminal window and proceed with installation of Android Studio by using the snap command:

$ sudo snap install android-studio --classic

This may take some time so be patient.


You can start the Android Studio using the bellow command:

$ android-studio


  • How to Install Android Studio on Ubuntu 20.04 Focal Fossa Linux

05 May 2020

https://linuxconfig.org/how-to-install-android-studio-on-ubuntu-20-04-focal-fossa-linux

Build your first app

https://developer.android.com/training/basics/firstapp

Overview

This section describes how to build a simple Android app. First, you learn how to create a "Hello, World!" project with Android Studio and run it. Then, you create a new interface for the app that takes user input and switches to a new screen in the app to display it.

Before you start, there are two fundamental concepts that you need to understand about Android apps: how they provide multiple entry points, and how they adapt to different devices.

With these two basic concepts in mind, proceed to the next lesson to build your first app!

Apps provide multiple entry points

Android apps are built as a combination of components that can be invoked individually. For example, an activity is a type of app component that provides a user interface (UI).

The "main" activity starts when the user taps your app's icon. You can also direct the user to an activity from elsewhere, such as from a notification or even from a different app.

Other components, such as broadcast receivers and services, allow your app to perform background tasks without a UI.

After you build your first app, you can learn more about the other app components at Application fundamentals.

Apps adapt to different devices

Android allows you to provide different resources for different devices. For example, you can create different layouts for different screen sizes. The system determines which layout to use based on the screen size of the current device.

If any of your app's features need specific hardware, such as a camera, you can query at runtime whether the device has that hardware or not, and then disable the corresponding features if it doesn't. You can specify that your app requires certain hardware so that Google Play won't allow the app to be installed on devices without them.

After you build your first app, learn more about device configurations at Device compatibility overview.

Create an Android project

Run your app

https://codelabs.developers.google.com/codelabs/build-your-first-android-app/#3


How to Create an Android App With Android Studio

This tutorial will teach you the basics of how to build an Android app using the Android Studio development environment. As Android devices become increasingly more common, demand for new apps will only increase. Android Studio is an easy to use (and free) development environment to learn on. It's best if one has a working knowledge of the Java programming language for this tutorial because it is the language used by Android.


There won't be much code used in this tutorial, so I will assume that you know enough Java to understand or are willing to look up what you don't know. This will take roughly 30-60 minutes, depending on how quickly you are able to download and install Android Studio. After using this tutorial to create your first Android app, you'll be well on your way to a fun new hobby or possibly even a promising career in mobile development.


https://www.instructables.com/id/How-To-Create-An-Android-App-With-Android-Studio/

Install Android Studio

Open a New Project

https://developer.android.com/training/basics/firstapp/creating-project

Open Android Studio.


In the Welcome to Android Studio window, click Start a new Android Studio project.

If you have a project already opened, select File > New > New Project.


In the Select a Project Template window, select Empty Activity and click Next.


In the Configure your project window, complete the following:

  • Enter "Hello Cat" in the Name field.
  • Enter "com.example.myfirstcat" in the Package name field.
  • If you'd like to place the project in a different folder, change its Save location.
  • Select either Java or Kotlin from the Language drop-down menu.
  • Select the lowest version of Android your app will support in the Minimum SDK field.
  • If your app will require legacy library support, mark the Use legacy android.support libraries checkbox.
  • Leave the other options as they are.


Click Finish.


After some processing time, the Android Studio main window appears.

Edit the Welcome Message in the Main Activity

Navigate to the activity_main.xml tab if it is not already open.


Make sure that the Design tab (on the upper right side of the window) is open on the activity_main.xml display.


In the project file system on the left side of the window, open the values folder.


In the values folder, double-click the strings.xml file.


In this file, find the line "Hello Cat".

<resources>
    <string name="app_name">Hello Cat</string>
</resources>


After the "Hello Cat" message, add "Hello girls! Welcome to my kingdom!"

<resources>
    <string name="app_name">Hello Cat</string>
    
    <string name="hello_girls">Hello girls! Welcome to my kingdom!</string>
    <string name="action_settings">Settings</string>
</resources>


Navigate back to the activity_main.xml tab.


Make sure that your centered text now reads "Hello girls! Welcome to my kingdom!"

Add a Button to the Main Activity

See also