Install Groovy on Linux
curl -s get.sdkman.io | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install groovy
References
http://www.groovy-lang.org/install.html
curl -s get.sdkman.io | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install groovy
References
http://www.groovy-lang.org/install.html
git add -A //stages All
git add . //stages new and modified, without deleted
git add -u //stages modified and deleted, without new
git log //Viewing the Commit History
References
http://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add
sudo add-apt-repository ppa:wine/wine-builds sudo apt update sudo apt install winehq-devel
public void buttonShow_onClick(View view) { Toast toast=Toast.makeText(this,"Hello",Toast.LENGTH_LONG); toast.show(); }
References
https://www.youtube.com/watch?v=6vixsiBlEOs&list=PLshdtb5UWjSp0879mLeCsDQN6L73XBZTk&index=10
https://github.com/mhdr/AndroidSamples/tree/master/005
https://developer.android.com/guide/topics/ui/notifiers/toasts.html
main_activity.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="iterator.ir.a004.MainActivity"> <Button android:text="Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:id="@+id/button" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_alarm_black_24dp" android:layout_below="@+id/button" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginLeft="10dp" android:layout_marginStart="10dp" android:id="@+id/imageButton" /> <Button android:text="Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2" android:layout_below="@+id/imageButton" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:drawableLeft="@drawable/ic_alarm_black_24dp" /> </RelativeLayout>
References
https://www.youtube.com/watch?v=EJ43o11ynGg&list=PLshdtb5UWjSp0879mLeCsDQN6L73XBZTk&index=9
https://github.com/mhdr/AndroidSamples/tree/master/004
main_activity.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="iterator.ir.a003.MainActivity"> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="textPersonName" android:text="" android:hint="@string/firstNameHint" android:ems="10" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:id="@+id/editTextFirstName" /> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="textPersonName" android:text="" android:hint="@string/lastNameHint" android:ems="10" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:id="@+id/editTextLastName" android:layout_toRightOf="@+id/editTextFirstName" android:gravity="center" android:layout_toEndOf="@+id/editTextFirstName" /> <Button android:text="@string/buttonSave_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/editTextLastName" android:id="@+id/buttonSave" android:layout_toRightOf="@+id/editTextFirstName" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" /> </RelativeLayout>
References
https://www.youtube.com/watch?v=QfF_oFPeh7c&list=PLshdtb5UWjSp0879mLeCsDQN6L73XBZTk&index=8
https://github.com/mhdr/AndroidSamples/tree/master/003
activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="iterator.ir.a002.MainActivity" android:orientation="vertical"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/to_hint"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/subject_hint"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/message_hint" android:layout_weight="1" android:gravity="top|left"/> <Button android:layout_width="100dp" android:layout_height="wrap_content" android:hint="@string/buttonSend_text" android:layout_gravity="right"/> </LinearLayout>
References
https://www.youtube.com/watch?v=DVRN3EuF9ys&index=7&list=PLshdtb5UWjSp0879mLeCsDQN6L73XBZTk
https://github.com/mhdr/AndroidSamples/tree/master/002
MainActivity.java
Button buttonShow; EditText editTextMessage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); buttonShow= (Button) findViewById(R.id.buttonShow); editTextMessage= (EditText) findViewById(R.id.editTextMessage); } protected void buttonShow_onClick(View view){ String message=editTextMessage.getText().toString(); Intent intent=new Intent(this,SecondActivity.class); intent.putExtra("msg",message); startActivity(intent); }
SecondActivity.java
TextView textViewMessage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); Intent intent=this.getIntent(); // Bundle bundle=intent.getExtras(); String message=intent.getStringExtra("msg"); textViewMessage= (TextView) findViewById(R.id.textViewMessage); textViewMessage.setText(message); }
References
https://github.com/mhdr/AndroidSamples/tree/master/001
com.android.support:support-compat:25.1.0 com.android.support:support-core-utils:25.1.0 com.android.support:support-core-ui:25.1.0 com.android.support:support-media-compat:25.1.0 com.android.support:support-fragment:25.1.0 com.android.support:multidex:1.0.0 com.android.support:design:25.1.0 com.android.support:support-annotations:25.1.0 com.android.support:customtabs:25.1.0 com.android.support:percent:25.1.0 com.android.support:exifinterface:25.1.0 com.android.support:recommendation:25.1.0
References
https://developer.android.com/topic/libraries/support-library/packages.html
public class Activity extends ApplicationContext { protected void onCreate(Bundle savedInstanceState); protected void onStart(); protected void onRestart(); protected void onResume(); protected void onPause(); protected void onStop(); protected void onDestroy(); }
References
https://developer.android.com/reference/android/app/Activity.html