Thursday, February 21, 2013

Android Review



1/ Create android app:
   - On eclipse go to File->New->Android Application project
   - Fill Application name "HelloWorld", Project Name, and Package Name then choose Build SDK version ->Next in order to Finish.

2/ To configure android on eclipse:
   - On eclipse go to Help ->Install New Software
   - Add new repository and android web site->Install 
   - After finish installation go to Window->Preferences->Android then browse to android sdk path
   - Click on icon AVD (Android Virtual Device) Manager -> Add new Device
   - Fill Name, Target, and Size-> Create AVD

3/ To use services on android:
  - open file AndroidManifest.xml
  - Click on Permission tab->Add ->Uses permission
 - Choose service name->Save.

or we can type:
 e.g: to use Internet
<use-permission android:name="android.permission.INTERNET" />

4/ Input data and retrieve with putExtras
 - input value 
      Intent in;
      in = new Intent(this, Activity2.class);
      in.putExtra("name", "bunthan"); 
      in.putExtra("age", "23");
      startActivity(in);


- to retrieve data in Activity2.java
 
        Bundle extras = getIntent().getExtras();
        if(extras == null) {
            return;
        }
        String name = extras.getString("name");
        int age = extras.getInt("age");


5/ use click
     ->android:onClick
     -in the xml file add android:onClick="showMe"
     -in the java file type 
     public void showMe(View v) {
          Toast.makeText(this, "This event clicked from XML.", Toast.LENGTH_SHORT).show();
     }      

   
   -> Anonymous class
     Button btnHelp = (Button) findViewById(R.id.btn_help);
     btnHelp.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                Intent i = new Intent(Activity1.this, Activity2.class);  
                startActivity(i);
            }
        });     


6/ Database
    declare global variable: 
  private SQLiteDatabase db; 
  private String db_name = "person";


    -> Create database or open if exists
    private void openDatabase(String dbname){
        db = openOrCreateDatabase(dbname, MODE_PRIVATE, null);
        db.execSQL("CREATE TABLE IF NOT EXISTS tbl_person(name VARCHAR, phone VARCHAR, email VARCHAR);");
    }


   ->Close Database
    private void closeDatabase(){
        db.close();
    }


 ->Insert new record
     private void insert(String name, String phone, String email){
        db.execSQL("INSERT INTO tbl_person VALUES('" + name + "', '" + phone + "', '" + email + "');");
    }

    
->Delete record
    private void delete(String name){
        db.execSQL("DELETE FROM tbl_person WHERE name='" + name + "';");
    }
  

->Update record  
    private void update(String name){
        db.execSQL("UPDATE tbl_person SET name='" + name + "';");
    }



-> retrieve all data containing name with String Search
   private void select(String search) {
        Cursor result = db.rawQuery("SELECT * FROM tbl_person WHERE name LIKE '%" + search + "%'", null);
        result.moveToFirst();
        
        while(!result.isAfterLast()){
            String name = result.getString(0);
            String phone = result.getString(1);
            String email = result.getString(2);
            
            //do something here
            TextView tv = new TextView(this);
            tv.setText("name: "+ name + ", phone: " + phone + ", E-mail: " + email);
            
            LinearLayout linlay = (LinearLayout)findViewById(R.id.LinearLayout1);
            linlay.addView(tv);
            //end of do            
            result.moveToNext();
        }
    }


Author: Bunthan Prak

Wednesday, February 20, 2013

Experimental photo collage using CSS3

This is an experimental photo collage. Shipon made this for his personal website but decided not to use a single photo instead. Instead of letting the code go to waste, he thought of sharing it. Enjoy!

Please do note the photo credit in the CSS file.
Reference: http://cssdeck.com/labs/collage

Friday, February 15, 2013

The eight key components of an effective business model

                              
                                                                                      businessmodelsinc

You will wonder what business model is. Business Model is a set of planed activities designed to result in a profit in a market place. In short, how to make money in business more effectively. I just review about business plan is a document that describe a firm's business model. So you know how it has connection each other between business plan and business model.

If you want to make more money for your business, you should have effective business model for your company. The eight key components of business model are:
  1. Value Proposition
  2. Revenue Model
  3. Market Opportunity
  4. Market Strategy
  5. Competitive Environment
  6. Competitive Advantage
  7. Organization Development
  8. Management Team
You should create your activities to reach your goal in your business to be an effective business model. So your business will increase more profit. Enjoy your own business model or you can do like what I listed above.

Related article: The True Definition of Income

The unique features of E-commerce

                                                                           writerlisamason

If you want to run your business online. you should know of what the features of E-commerce have for you.

The unique features of E-commerce is listed below:
1. Ubiquity: Internet/web technology conducts your business 24*7*365 which available everywhere: at work, at home, and elsewhere via mobile devices, any time.
2. Global Reach: The technology reaches your business accross the national bouderies around in the world
3. Universal Standard: There is one set technology standard, namely internet standard.
4. Richness: Video, audio and text message are posible.
5. Interactivity: The technology works through interaction with user.
6. Information density: The technology reduces cost and raise quality.
7. Personalization and customization: The technology allows personalized messages to be delivered to individuals as well as groups.

All above are the features of E-commerce that make you decide to create business online.