Showing posts with label TECHNOLOGY. Show all posts
Showing posts with label TECHNOLOGY. Show all posts

Friday, February 14, 2020

Manifest (Android Studio)

Manifest
Each application must have an AndroidManifest.xml file (named exactly like this) in the root directory. The manifest file provides important information about the application to the Android system, information that the system must have in order to run each application code. Among other things, the manifest does the following:

1. Name the Java package for the application. The package name functions as a unique identifier for the application.

2. Describe the various components of application-activities, services, broadcast receivers, and content providers that make up the application. Name the class that implements each component and publishes its capabilities (for example, which Intent messages it can handle). This declaration tells the Android system about its components and in what conditions can be launched.

3. Determine the process that will host application components.

4. Declares which application permissions you must have to access the protected part of the API and interact with other applications.

5. Also declare other permissions that must be had to interact with application components.

6. Include a list of Instrumentation classes that provide profiles and other information when the application is running. This declaration only exists in the manifest when the application is created and tested; The declaration is deleted before the application is published.

7. Declares the minimum Android API level required by the application.

8. List the bibliography which the application must link to.

Structure
The diagram below shows the general structure of the manifest file and each element that can be contained. Each element, along with its attributes, is fully documented in a separate file. To see detailed information about each element, click the name of the element in the diagram, in the alphabetical list of elements that follow the diagrams, or the mention of other element names.


Element
Only the <manifest> and <application> elements are required, each must be present and may only occur once. Generally other elements can occur many times or absolutely not occur even though some of the elements must be present for the manifest to achieve something meaningful.
If an element contains nothing, it means that the element contains other elements. All values ​​are set via attributes, not as character data in elements.
Elements of the same level are generally not sorted. For example, the <activity>, <provider>, and <service> elements can be mixed in any order. (The <activity-alias> element is an exception for this rule. This element must follow the alias <activity>.)

Attribute
Formally, all attributes are optional. However, there are parts that must be determined so that the element can achieve its objectives. Use documentation as a guide. For attributes that are truly optional, this either mentions the default value or states what happens if there is no specification.
In addition to some <manifest> root element attributes, all attribute names begin with the Android prefix: for example, Android: alwaysRetainTaskState. Because this prefix is ​​universal, documentation generally removes it when referring to attributes by name.

Declaration
Many elements are related to Java objects, including the application element itself (<application> element) and its main component activities (<activity>), service (<service>), broadcast receiver (<receiver>), and content provider (<provider> ).
If defining subclasses, as you always define for component classes (Activity, Service, BroadcastReceiver, and ContentProvider), subclasses are declared via the name attribute. The name must include the full package destination. For example, the Service subclass might be declared as follows:


However, as shorthand, if the first character of the string is a dot, the string will be added to the application package name (as specified in the <manifest> element via the package attribute). The following designations are the same as above:


When starting a component, Android will create a subclass named named. If no subclass is specified, a base class instance will be created.

Multiple View
If more than one value can be set, this element is almost always repeated, not displaying a list of many values ​​in one element. For example, the intent filter can include several actions:


Resource
Resource values ​​use the following format:


String
When the attribute value is a string, two left slashes ('\\') must be used to leave the character, for example '\\ n' for new lines or '\\ uxxxx' for Unicode characters.



Wednesday, February 12, 2020

Widgeting (Android Studio)

There are various kinds of widgets provided by Android. Some of them are as follows:
TextView
TextView is used to display text to the user and can be optionally edited. TextView is basically a text editor, but by default it can't be edited. Following are some of the important attributes of TextView that are frequently used.
id (the unique ID used for reference in use).Widgeting
editable (If set to true, it will function as input).
fontFamily (for family font settings used).
text (the text that will be displayed).
textSize (Size of text in units of sp)
textStyle (Style (bold, italic, bolditalic). Can be used one or more by separating with the sign "|"
normal - 0
bold - 1
Italic - 2

The full attributes of the TextView widget can be seen on the https://developer.Android.com/reference/Android/widget/TextView.html page.

Edit Text
EditText is an overlay of a TextView whose default settings are set so that it can be a little. This is a subclass defined from TextView that includes rich text editing.

Style from EditText

Button
Button is a push-button that can be clicked by the user to perform certain actions. Each Button has a default style of operating system used by the device.

Example of an Android Button

Spinner
Spinner allows you to select items from the drop down menu. For example, when you use the Gmail application, you will get a drop down menu as shown below.

Examples of Spinners in the Option Menu

Read: https://knowledgefrans.blogspot.com/2020/02/manifest-android-studio.html?m=1


Project Structure (Android Studio)

As a start we discussed the Android Studio project structure. When we create an application project with Android Studio, we will get several packages, folders, and files that are in the project. To be able to see the structure of the project, we must first create a project with Android Studio. Please create a project and fill in the name of the project that we will create.

1. First open the Android Studio application. Select Start a new Android Studio project, after which the following picture will appear.

Select Start a new Android Studio Project

2. Fill in the name and press the Next button. Then it will be redirected to the next page as shown below.

Fill in the name of the Application

3. Check the phone and tablet (this is because we build applications used for mobile phones and tablets) and select the minimum SDK. Here I use the minimum SDK API 15 Android 4.0.3 (meaning the application features that we make support Android v4.0.3 and above). Then press the Next button.

Complete Application data

4. At this stage you will be asked to choose a template that will be used in building the application. Since we are going to start from the basics, it is recommended to choose the Empty Activity template. Then press Next.

Choose a template

5. Fill in the name of the activity that we will use. The name is up to you. After that press Finish and wait a few moments.

Fill in the name of the Activity

6. Creating a project with Android Studio is complete.

Android Studio Project Structure

7. Following is the picture along with an explanation of the Android Studio project structure that I have tried to make above.

Android Studio Project Structure

The explanation of the structure is as follows:

Manifest (app / manifest / AndroidManifest.xml)
The first manifest folder contains the AndroidManifest.xml file. This file contains components from applications such as activity, services, user permissions, content providers, and others.

Java (app / packagename / MainActivity.java)
The second folder, java, contains command files with java extension. In it there is also a java activity class file that is in the application.

res
This folder contains drawables, layouts, mipmaps, and values. Drawable contains a collection of images that we will use in the application. Layout is a place where the application's layout design file is located. Mipmap contains icons that we will use in the application, and values ​​are places to store files such as colors, color strings (text data declarations that we will use for application components), and styles (contain resources about themes such as toolbar names) .

Gradle
Is a build tool used to run Android Studio applications. The build.gradle file is used to identify the OS, SDK, and library versions that we will use in building applications.

Read: https://knowledgefrans.blogspot.com/2020/02/widgeting-android-studio.html?m=1


Tuesday, February 11, 2020

Emulator (Android Studio)

To try a program created in Android Studio, an Android emulator is required. Or you can also directly run using an Android smartphone. Keep in mind that running an Android program via an emulator requires more computer RAM than using a smartphone. We recommend that the computer has 8GB of RAM or more if you want to use an emulator.
There are several Android emulator software that can be used, for example, the Android Virtual Device (AVD) provided by the Android SDK or emulators provided by third parties such as Genymotion.

Android Virtual Device
To use the Android Virtual Device, the steps are as follows:

1. Open AVD Manager via the Tools menu > Android > AVD Manager. Or by clicking on the AVD Manager icon on the toolbar.

AVD Manager button on Android Studio

2. Click the Create Virtual Device button.

Create Virtual Device button

3. Select the device category you want to use (TV, Wear, Phone, or Tablet). Then select the screen size for the AVD to be created.

Select the device category

4. Select the system image for the AVD to be created. The system image determines the version and architecture of the Android image used.

Select the system image

5. Name the AVD.

Give the name AVD

Genymotion
Apart from AVD you can also use other emulators. One example is Genymotion. In addition to Genymotion there are still other emulators that can be tried. Following are the steps to install Genymotion.

1. Genymotion requires the VirtualBox application. Install VirtualBox first. Download the VirtualBox installer file according to the operating system used at https://www.virtualbox.org/wiki/Downloads.

2. Install VirtualBox on the computer.

3. Download the free version of Genymotion namely Genymotion Personal Edition at https://www.genymotion.com/fun-zone/.

4. Install Genymotion.

5. The next step is to download the Android image. Click the Add button, then select the Android version and Device model.

Add button in Genymotion
Select the Android version and device model

6. Name the virtual device that was made.

Give the name of the virtual device

7. To be able to use Genymotion, install the Genymotion plugin in Android Studio. The trick is to click the File menu> Settings> Plugins then type Genymotion and install.

Add the Genymotion plugin to Android Studio

Emulator Device
This may be what the developers are looking for, how to use our mobile devices for direct simulations. Why do we use cellphones to build Android applications? The answer is that our laptop is lighter when we are coding Android. Our laptop RAM is more efficient because it is not used for Android emulators which is quite tiring and sometimes upsetting.
The necessary preparation is to provide:
》 Android mobile.
》 USB cable connecting the handphone to the laptop.

Make sure the handphone driver is installed on the computer. How to install it is very easy, just connect the handphone to the laptop. Usually drivers for mobile phones are available / default from the cellphone itself or through internet downloads.

For example if we have saved in the My Computer directory,

Mobile Driver

After the driver is ready to be installed, please check the Device Manager.

Device Manager
Check Device Manager

Next, activate the development mode and USB debugging on the handphone. The trick, open Settings > More > Developer option (for this location depends on the mobile phone used).

Enable Developer options and USB debugging

Run the application

Next, open Android Studio and do the run project that was created (create an Android Studio project).

Choosing application development targets

From the picture above can be seen Android devices (cellphones) that we will use to run Android applications.

To more easily manage Android devices on the desktop, we can install the Vysor application on laptops and Androids. For the Vysor application is as an Android remote on the desktop.

Vysor Android Application

Read: https://knowledgefrans.blogspot.com/2020/02/project-structure-android-studio.html?m=1

Sunday, February 9, 2020

Java Development Kit (JDK) - Android Studio

One of the requirements of Android Studio is JDK or Java Development Kit. Therefore, the first step that must be done before installing Android Studio is to install JDK. JDK can be downloaded at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html.

The following are the steps for installing the JDK jdk-8u65-windows-x64.

JDK installation

Package Selection

The process is waiting for installation

Selection of installation location

The installation process takes place

Read: https://knowledgefrans.blogspot.com/2020/02/installing-android-studio.html?m=0


Basic Introduction (Android Studio)

Android studio is an Integrated Development Environment (IDE) software tool for the Android platform. Android Studio was launched on May 16, 2013 at the Google I / O Conference by Google Product Manager, Ellie Powers.


This Android studio is free under Apache License 2.0. Android Studio initially started with version 0.1 in May 2013. Then beta version 0.8 was released which was released in June 2014. The most recent was released v.3 in October 2017. Based on JetBrainns' IntelliJ IDEA, Studio was designed specifically for Android Development. Now it can be downloaded for Windows, Mac OS X, and Linux. The free download location of this application is at https://developer.Android.com/studio/index.html?hl=en.

Download Android Studio for Windows (681Mb)

New features are expected to be added with each release of Android Studio. Here are some of the features provided in the current stable version:
》 Instant Run dramatically speeds up the editing, manufacturing and running cycles to keep your work "flowing".
》 The new Android Emulator 2.0 is faster than before and allows you to dynamically resize the emulator and access a set of sensor controls.
》 With Gradle, Android Studio offers high-performance application creation automation, robust dependency management, and customizable version configurations.
》 Android Studio provides a unified environment for developing applications for Android phones and tablets, Android Wear, Android TV, and Android Auto.
》 Start the project with code templates for patterns such as the navigation drawer and display pager, or import Google code samples from GitHub.

Read: https://knowledgefrans.blogspot.com/2020/02/hardware-requirements-
android-studio.html?m=1


Basic Program

Building an Android Application is very easy, the programming language used by Android is java. Not all java features are used, but only a part of java is often called the Dalvik Virtual Machine (DVM). Some small parts of the Android framework use the XML language for scripting.
1. Activity. A container for the User Interface (UI). An Android Application is built from one or several Activities.

2. Intent. Is the main messaging system that runs Android. Intent consists of actions that must be executed (Show, Change, Dial, etc) and Data. Intent is used to start activities and communication between parts of the Android system. An application can send or receive intents.

》 Send messages with intent
When an application sends an intent, the application gives a message telling Android to run something, for example an Activity from the application or running another application.

》 Registering the Intent Receiver
Sending messages with an Intent doesn't mean that the next thing will happen automatically. The application must register an intent receiver that pays attention to the intent and tells Android what to do. For example, if a user long presses on an image in the image gallery, a context menu will appear related to image sharing. Because there are several receivers that are registered relating to image sharing (email, messaging, Bluetooth, etc). Then the context menu is raised to give decision options to the user.

3. Cursorless Controls. Android devices use the user's fingers as input. If you use a mouse pointer on a computer, then left-click to interact with a button, then Android users can use their fingers directly to the button. To replace the right-click, Android users can press their finger for a long time on the screen, then the context menu will appear.

4. Views and Widgets. View is a basic UI (User Interface) element. For example the area of ​​the box on the screen that is responsible for displaying and receiving events (event handling).
Some examples of Widgets: (1) Button, (2) CheckBox, (3) DatePicker, (4) DigitalClock, (5) Gallery, (6) FrameLayout, (7) ImageView, (8) RelativeLayout, (9) PopupWindow.

5. Asynchronous Calls. Android has a class called AsyncTask that allows applications to run several operations at the same time without having to set how the thread runs specifically. AsyncTask allows developers to build clean model programs for asynchronous processes. Asynchronous processes are used for processes that require a long time, such as Network Communication (Internet), Media Processing, and various other processes that require users to wait. If the user has to wait, then the asynchronous process can be used to display a UI that tells the user what happened.

6. Background Services. Services are applications that run in the background and don't really have a UI, for example antivirus. Most music players from the Android Market run as Background Services where users can listen to music while checking e-mail or perform other tasks that require the use of screen displays.

Read: https://knowledgefrans.blogspot.com/2020/02/basic-introduction-android-studio.html?m=1


Versioning

The Android operating system consists of several versions. Each latest Android version has its own unique names and has several types of advantages ranging from display to security optimization. The following is a list of Android OS names by version.


1. Android version 1.0 was released on 23.09.2008.

2. Android version 1.1 was released on 09.02.2009.

3. Android version 1.5 Cupcake was released on 30.04.2009.
It is the first version to be released commercially and is also first named after the cake. This version of Android has just begun to add features that are commonly found today such as Widgets, Auto Rotate, and support for virtual keyboards from third parties. In this stage it can be said that Google is still trying to incorporate basic features.

4. Android version 1.6 Donut was released on 15.09.2009.
On Android Donut, smartphones get several additional features such as CDMA support, a text to voice engine, and a battery usage indicator. The version number that is not much different than before makes Android Donut more as a mini update.

5. Android version 2.0 Eclair was released on 26.10.2009.
There are quite a lot of changes compared to the initial Android version. In this update Google provides support and new features that function to make it easier for users. Android Eclair gets several new features that are mainly on the camera application by adding flash support, focus, to color effects. In this version Google also added a Live Wallpaper that is pretty cool at the beginning of its appearance.

Display Android Cupcake, Donut, and Eclair

6. Android version 2.2 Froyo, released on 10.05.2010
In this version, Android experienced significant performance optimization and added with USB Tethering support. Wi-Fi Hotspots, and push notifications are very useful to date. Also in this version we can move the application to external storage if possible.

7. Android version 2.3 Gingerbread is classified as the most successful, released on 06.12.2010.

        Display Android Froyo and Gingerbread

8. Android version 3.0 Honeycomb has the best appearance and best performance. Released 22.02.2011.
The current operating system is specific to tablet devices. In this Honeycomb some useful features still survive today such as the System Bar, multi-core processor support, to the customizable Home screen. Android 3.0 Honeycomb at launch looks very futuristic and attracts a lot of attention.

                 Display Android Honeycomb

9. Android version 4.0 Ice Cream Sandwich already supports Flash Player, released on 19.10.2011.
Google unifies smartphone and tablet devices and adds a more minimalistic interface. One of the interesting new features on this version of Android is Android Beam which allows fast data transfer using NFC.

10. Android version 4.1 Jelly Bean has advantages in battery, gesture navigation, and camera. Released 09.07.2012.
This version is more focused on improving performance and security. Most of the improvements in the Android version occur on the Android system itself. But there is one feature that really needs to be known, namely support 4K UHD resolution.


Display of Ice Cream Sandwich, Jelly Bean, and Kitkat

11. Android version 4.4 Kitkat released on 31.10.2013.
Focus on improving user experience and performance, especially on lower-class devices. Android 4.4 KitKat provides a minimum limit of available RAM for Android of 512 MB so that devices that have RAM below that are classified as low RAM devices. The newest features are:
》 Screen recording.
》 New Translucent UI system.
》 Improved notification access.
》 System-wide settings for closed captioning.
》 Performance improvement.
》 Activate Sprint Spark band 26 and band 41.
》 Repair vulnerabilities in Heartbleed / OpenSSL.

12. Android version 5.0 Lollipop released 17.10.2014.
It was the first time carrying a material design that is still a trend today. Its features are:
》 New design (Material).
》 Speed ​​increase.
》 Increased battery life.
》 Repair video playback and password failure.
》 Support Multi SIM cards.
》 Shortcuts in Quick settings for Wi-Fi and Bluetooth.
》 Security if the device is lost or stolen.
》 Use of High Definition sound for the phone.
》 Increased stability performance.

13. Android version 6.0 Marshmallow was released on 28.05.2015.
It further strengthens what has been done by Google so far through Android Lollipop. Through this latest operating system, Google brings powerful features that are very useful such as:
》 Support USB Type-C.
》 Support fingerprint authentication (Fingerprint).
》 Battery life is further enhanced by Doze's battery consumption management.
Dashboard Permissions dashboard.
》 Access the UI Tuner System.
》 Support payment systems with Android Pay that collaborate with Fingerprint Authentication so that security is guaranteed.
》 Additional Google Now functions that don't just serve voice commands.

14. Android version 7.0 Nougat introduced 22.08.2016.
Provides improvements to the user experience to make it easier. The multi-window support feature is a major concern so users can use several applications simultaneously. There are also features that make operating system updates smoother and less noticeable when the device is not in use.
》 Multi-window support.
》 Reply directly to messages from the notification window or menu.
》 Display new notification panel and quick settings.
》 Enhanced Doze Mode (Doze Mode 2.0).
》 Menu between system settings.

Display of Lollipop, Marshmallow, and Nougat

15. Android version 8.0 Oreo was officially released on 21.08.2017.
》 Android O is more focused on speed and efficiency.
》 Boot speed up 2X faster.
》 Picture in picture mode is more flexible than Android N.
》 Applications that are running in the background are tightened to save battery life.
》 The battery lasts longer.
》 Updated emojis and more.

Display Android Oreo

The following is a table of the number of Android users up to October 2017. The highest order is Android Marshmallow, Lollipop, Nougat, and Kitkat. When we choose that the application will be used on Marshmallow, it will be ensured that the most users will not get many problems when running the application that we offer.
In addition to the Android version, what we are considering is the screen size used. Currently the most popular is the normal screen with xhdpi. Please check the image below.

Android users based on the version

Android users by screen

Read: https://knowledgefrans.blogspot.com/2020/02/basic-program.html?m=1

Android features

Android devices have several hardware features in them. This is what developers can use in building applications.
Among others are:
1. Touchscreen. Android devices have a touchscreen feature that gives users the possibility to interact with applications using their fingers. Users can swipe, flip, drag, and pinch to zoom. Android also supports multitouch which means the entire screen can be touched with one or more fingers at the same time
2. GPS. The Android operating system supports GPS which allows developers to access user locations. Examples of applications that utilize GPS are map applications that show the user's location and provide instructions for getting to a location.
3. Accelerometer. Android supports the Accelerometer, which is a device used to measure acceleration. An accelerometer can tell when an Android device is moving, shaking, or reversing its position.
4. SD Card. Android has a feature that allows users or other applications to access (save or open) files on the SD Card. SD Card is a storage medium that is used by Android devices and several other mobile devices.
Android has many software features that can be used by developers in developing applications, namely:
1. Internet. The ability to access the internet on Android provides many advantages. Various information in real-time can be obtained easily with the internet. Users can access the internet to see movie show schedules, weather of an area, flight schedules and more. Developers can use the internet to access / update data in realtime. Developers can also use the internet to store various assets for later use in an application, such as by Pandora and Youtube. With the internet, an application model called client-server computing can be built. Another example, a map application accesses map and GPS data from a web server.
2. Audio and Video Support. The Android operating system allows developers to easily include audio and video in the application. Various standard audio and video formats are supported.
3. Contact. Android allows access to contacts stored on the device. For example, developers can build applications that combine contacts with GPS to provide notifications if a user is near the address of one particular contact.
4. Security. Android allows applications to do many things. Android also prepares security mechanisms in the form of permissions relating to several tasks. Example: To download an image and save it on the SD Card, you must first approve the permission to access the SD Card.
5. Google APIs. The Android operating system makes it possible to unlimitedly make phone calls, organize contacts or install applications. Developers can also integrate maps into an application by using the Maps API which contains Map Widgets. Various features can be added with the Maps API, including: (1) Displaying a location on the map, (2) getting a navigation guide, (3) data communication between applications and clouds.

Read: https://knowledgefrans.blogspot.com/2020/02/versioning.html?m=1

Why Choose Android

Choosing the Android operating system for mobile devices is appropriate because under Google it must be developed constantly. The most interesting thing is as a developer can also freely create Android-based applications. We can sell it as a product, service, or as a solution to the problem for its users.
Actually in addition to Android there are also other operating systems such as iOS, Linux, Blackberry, Symbian, and also Windows Mobile (WM). All have advantages and disadvantages. Android has proven the most widely owned today. In essence, there is no loss in choosing Android as a user or as a developer (program maker).
Android provides a rich development architecture. We don't need to know much about these architectural components, but we need to know what is available in the system used for our application. The following diagram shows the main components of the Android level system, an overview of the operating system, and the architecture of development.


The main component of Android

In the picture above:
1. Application: Applications are at this level along with core system applications for e-mail, SMS messaging, calendar, internet browsing or contacts.
2. Java API Framework: All Android features are available to developers through the application programming interface.
Display system is used to build application UI, including lists, buttons, and menus.
Referensi Reference Manager is used to access non-code resources such as strings, graphics, and layout files.
》 Notification Manager is used to display special warnings in the status bar.
Aktivitas Activity Manager that manages the application life cycle.
》 Material Providers that allow applications to access data from other applications.
》 All the framework APIs that are used by Android system applications.
3. Library and Android runtime: Each application runs in its own process and with its own Android Runtime instance, which allows multiple machines at once virtual on low-memory devices. Android also includes a series of core processing time libraries that provide most of the functionality of the Java programming language, including some features of Java 8 that are used by the Java API framework. Many core Android system services and components are built from native code that requires native libraries written in C and C ++. The native library is available for applications through the Java API framework.
4. Hardware Abstraction Layer (HAL): This layer provides a standard interface that shows the hardware capabilities of the device to a higher Java API framework. The Hardware Abstraction Layer consists of several library modules, each of which implements an interface for certain hardware components, such as a camera or bluetooth module.
5. Linux Kernel: The foundation of the Android platform is the Linux kernel. The layer above relies on the Linux kernel for basic functionalities such as threading and low-level memory management. Using the Linux kernel allows Android to take advantage of key security features and allows device manufacturers to develop hardware drivers for a well-known kernel.

Read: https://knowledgefrans.blogspot.com/2020/02/android-features.html?m=1



Saturday, February 8, 2020

What is Android?

Android is a Linux-based operating system designed for touch screen mobile devices such as smartphones and tablet computers. Android was originally developed by Android, Inc., with financial support from Google, which later bought it in 2005. The operating system was officially released in 2007, in conjunction with the establishment of the Open Handset Alliance, a consortium of hardware, software, and telecommunications that aim to advance the open standards of cellular devices. The first Android phone went on sale in October 2008.


Android display for Espier Launcher

Android user interface is generally in the form of direct manipulation, using touch gestures similar to real actions, such as sliding, tapping and pinching to manipulate objects on the screen, as well as virtual keyboards for writing text. In addition to touch screen devices, Google has also developed Android TV for television, Android Auto for cars, and Android Wear for watches. Each has a different user interface. The Android variant is also used on portable computers, game consoles, digital cameras, and other electronic equipment.

Various Android Products from Google

Read: https://knowledgefrans.blogspot.com/2020/02/why-choose-android.html?m=1



ENGLISH PHRASES

YOUTUBE   ENGLISH PHRASES  no one said it was to be going easy.  tidak ada yang mengatakan itu akan berjalan mudah.  that wasn't the re...