Primary TextView and EditText in Android 1. How to use simple TextView in android Write this code in .xml file <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="...
Python Basic Program - Python Programming Language Program 1: print("For print a massage") print("Hello Python!") Output: For print a massage Hello Python! Program 2: print("For addition of two number") a = 10 b = 20 sum = a+b print("Sum of two number is ",+sum) Output: For addition...
Python Decision Making & Loops - Python Programming Language Decision Making Decision making is anticipation of conditions occurring while execution of the program and specifying actions taken according to the conditions. Decision structures evaluate multiple expressions which produce TRUE or FALSE as outcome. You need to determine which action to take and which statements to execute if outcome is...
Python Operators - Python Programming Language Operators are the constructs which can manipulate the value of operands. Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator. Types of Operator: Python language supports the following types of operators. 1. Arithmetic Operators 2. Comparison (Relational) Operators 3. Assignment Operators 4....
Python User Input - Python Programming Language There are hardly any programs without any input. Input can come in various ways, for example from a database, another computer, mouse clicks and movements or from the internet. Yet, in most cases the input stems from the keyboard. For this purpose, Python provides the function input(). input has an...
Python Variables Declaration & Standard Data Types - Python Programming Language Variables Declaration: Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the reserved memory. Therefore, by...
Python The Introduction to Python Programming Language Python is an example of a high level language.Other high level languages you might have heard of are C++,PHP,Pascal,C#,and Java. Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Install...
Primary Lesson 10: Stopping and Restarting an Activity Properly stopping and restarting your activity is an important process in the activity lifecycle that ensures your users perceive that your app is always alive and doesn't lose their progress. There are a few of key scenarios in which your activity is stopped and restarted: The user opens...
Primary Lesson 9: Pausing and Resuming an Activity During normal app use, the app sometimes loses focus, causing the activity to pause. For example, when apps run in multi-window mode, only one of the apps has the focus at any time; the system pauses all other apps. Similarly, when a semi-transparent activity opens (such as one in the...
Primary Lesson 8: Starting an Activity Unlike other programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle. There is a sequence of callback methods that start up an activity and a sequence...
Primary Lesson 7: Supporting Different Platform Versions While the latest versions of Android often provide great APIs for your app, you should continue to support older versions of Android until more devices get updated. This lesson shows you how to take advantage of the latest APIs while continuing to support older versions as well. The dashboard for...
Primary Lesson 6: Supporting Different Screens Android categorizes device screens using two general properties: size and density. You should expect that your app will be installed on devices with screens that range in both size and density. As such, you should include some alternative resources that optimize your app’s appearance for different screen sizes and...
Primary Lesson 5: Supporting Different Languages It’s always a good practice to extract UI strings from your app code and keep them in an external file. Android makes this easy with a resources directory in each Android project. If you created your project using the Android SDK Tools (read Creating an Android Project), the tools...
Android Lesson 4: Starting Another Activity After completing the previous lesson, you have an app that shows an activity (a single screen) with a text field and a button. In this lesson, you’ll add some code to MainActivity that starts a new activity when the user clicks the Send button. Respond to the Send Button...
Android Lesson 3: Building a Simple User Interface In this lesson, you create a layout in XML that includes a text field and a button. In the next lesson, your app responds when the button is pressed by sending the content of the text field to another activity. The graphical user interface for an Android app is built...