Category Archives: Android

Android send mail with android mail setup.

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:

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>

Posted in All, Android, Programming. Tagged with , , , , , , .

Android Studio – tools and features – part 007

If you try to update your old Android Studio to Android Studio 1.2 RC 2 you may got this error:
The following SDK components were not installed: …
Most commons errors are for this components:
extra-android-m2repository,tools,addon-google_apis-google-21,android-21,sys-img-x86-addon-google_apis-google-21,source-21,extra-google-m2repository…
After this error the process of installation it’s stopped running.
To fix this you need to take a look to this path : …\AppData\Local\Android\sdk1
Start the : SDK Manager.exe application to update all your SDK components…
…or try to run android.bat command from tools folder : tools\android.bat update sdk –no-ui
After that the installation / update of Android Studio will be like in the next images.
android
android2
Then make all settings
android3

Posted in All, Android, Programming. Tagged with , , , , .

Android Studio – tools and features – part 006

You can quickly filter through commands by using the Find Actions shortcut.
That can be show you with : Ctrl+Shift+A keys and you will see the next dialog like into the next picture.
android-adb-key

Posted in All, Android, Programming. Tagged with , , , .

Android calendar application example – part 1.

This is a simple example about using widget calendar under Andoid OS.
Can be easy to do it if you know the basic of the programming.
First you need to make one application ( I use Android Studio – version 0.5.1).
Let’s see my example:
My application use:
the class is :
public class MainActivity extends ActionBarActivity
the project is set with this :
com.example.calendar.app
the widget is : CalendarView
I make this changes into this source files :

  • MainActivity,java
  • AndroidManifest.xml
  • activity_main.xml
  • main.xml
  • strings.xml

Let’s see the source code for this files:
The result working well. Also you can see in this picture the calendar result …

MainActivity.java



AndroidManifest.xml



activity_main.xml



main.xml



strings.xml



The result working well. Also you can see in this picture the calendar result …


android_calendar_001

Posted in All, Android, Programming, Windows 8. Tagged with , , , .

Android Studio – tools and features – part 005

Most of us have one old project. When we want to import this project into new Android Studio with a new SDK then will got one error.
In the next picture will see the steps to fix your new Android SDK.
android-tips-001
This will allow you to fix your Android SDK with the new one.

Posted in All, Android, Programming. Tagged with , , , .