I used AIDE development tool under my phone.
The main reason was : this IDE come with a simple default project.
The Android Studio can you give yourself a headache…
The AIDE will make all your files under your project.
I named my project MyAppMailSend with MainActivity.
So the java class will be MainActivity – public class MainActivity extends Activity.
Also I used Intent named ig .
Under XML files I need to put intent-filter and all @string , @drawable and @style.
The AndroidManifest.XML file :
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android”
package=”com.mycompany.myapp” >
<application
android:allowBackup=”true”
android:icon=”@drawable/ic_launcher”
android:label=”@string/app_name”
android:theme=”@style/AppTheme” >
<activity
android:name=”.MainActivity”
android:label=”@string/app_name” >
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</activity>
</application>
</manifest>
Under this path MyAppMailSend\app\src\main\java\com\mycompany\myapp you wil have this file MainActivity.JAVA:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | package com.mycompany.myapp; import android.app.*; import android.os.*; import android.content.*; import android.content.Intent; import android.net.Uri; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent ig = new Intent(Intent.ACTION_SEND); ig.setData(Uri.parse("mailto:")); String [] to={"your@gmail.com"}; String [] cc={"your@gmail.com"}; ig.putExtra(Intent.EXTRA_EMAIL,to); ig.putExtra(Intent.EXTRA_CC,cc); ig.putExtra(Intent.EXTRA_SUBJECT,"testing android"); ig.putExtra(Intent.EXTRA_TEXT,"subject of mail"); ig.setTypeAndNormalize("message/rtc822"); startActivity(ig); } } |
The \MyAppMailSend\app\src\main\res\layout\main.XML file:
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:gravity=”center”>
<TextView
android:text=”@string/hello_world”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content” />
</LinearLayout>