Pages

Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Tuesday, July 5, 2016

Android Mobile Mindset Programming


android mindset programming

Although Android can support almost all of our formal activity but there are several factors that we have to consider for basic mindset before we start create or make some development.
These factors are really important,as we know that mobile devices such as android mobile is design for smart gadget which help us doing many things in everywhere anywhere.So mobile devices should really portable and easy to carry out.
Small and portable, mobile devices offer exciting opportunities for software development. Their limited screen size and reduced memory, storage, and processor power are far less exciting, and instead present some unique challenges.
Compared to desktop or notebook computers, mobile devices have relatively issue:
  1. Low processing power
  2. Limited RAM
  3. Limited permanent storage capacity
  4. Small screens with low resolution
  5. Higher costs associated with data transfer
  6. Slower data transfer rates with higher latency
  7. Less reliable data connections
  8. Limited battery life
So what is the mobile mindset programming to handle the issue.
Coding should Be Eficient
Manufacturers of embedded devices, particularly mobile devices, value small size and long battery life over potential improvements in processor speed. For developers, that means losing the head start traditionally afforded thanks to Moore’s law. The yearly performance improvements you’ll see in desktop and server hardware usually translate into smaller, more power-eficient mobiles without much improvement in processor power.
In practice, this means that you always need to optimize your code so that it runs quickly and responsively, assuming that hardware improvements over the lifetime of your software are unlikely to do you any favors.
Read More..

Thursday, April 3, 2014

Share Your Data Android Programming

This example shows how you can share your text and data with your friends.
Algorithm:
1.) Create a new project by File-> New -> Android Project name it ShareYourData.
2.) Write following into activity_main.xml:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#C0C0C0"
    android:orientation="vertical" >
    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Share Data"
        android:onClick="shareData"
        />
</LinearLayout>
3.) Write following into res/values/styles.xml:
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="myText">
        <item name="android:textColor">#000000</item>
        <item name="android:textSize">22sp</item>
        <item name="android:padding">3dip</item>
    </style>
</resources>
4.) Run for output.
Steps:
1.) Create a project named ShareYourData and set the information as stated in the image.
Build Target: Android 4.0
Application Name: ShareYourData
Package Name: com. example. ShareYourData
Activity Name: MainActivity
Min SDK Version: 11
2.) Open MainActivity.java file and write following code there:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.example.shareyourdata;
 
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
 
public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        }
    public void shareData(View view) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(Intent.EXTRA_TEXT, "This is my shared text");
        startActivity(Intent.createChooser(intent, "Share this text via"));
    }
}
3.) Compile and build the project.
Output
Read More..