Pages

Showing posts with label what. Show all posts
Showing posts with label what. Show all posts

Thursday, April 28, 2016

Android Technically What Is It

Android - Technically what is it?
    (an overivew of what is Android and its uniqueness is discussed in another post below)

    1. It is an operating system for mobile
    2. Interestingly, it is not yet another OS, but component based
      OS
    3. It has an integrated Java Virtual Machine
    4. System interfaces are exposed only through Java libraries
    5. It is based on the Linux Kernel
    6. An Android SDK is provided to let developers build applications on top of the OS but not extend the OS itself
    7. The SDK includes

      • Android packages
      • sample files
      • Documentation
      • A Simulator
The offical site of Android broadly classfies the technical parts of the OS as
consisting of
  1. Linux Kernel
  2. Android Runtime
  3. Libraries
  4. Application Framework
over which the core applications run as well as the applications developed by anyone using this framework
Read More..

Saturday, March 26, 2016

lse"" Na"

android,and,its,fragmentation
Read More..

Sunday, February 28, 2016

Date and Time Picker Views Android Developer Tutorial Part 20

Continuing my tutorials on some UI related stuff… In Part 16 & 17, I spoke about Simple ListView and Custom ListView. In Part 18, though it seems like a tutorial on Threads and Handlers, I have touched upon ProgressDialog, another view.


Here I would like to talk on the DatePicker and TimePicker that are bundled with the SDK. Both are very similar. So, I will talk only about DatePicker, but the sample code will have both.

Typically, we would want an end user to be able to set a date though a DatePickerDialog that pops-up on some user action. So, I have a button “Set Date” on the click of which a DatePickerDialog pops-up. Once the user selects a date and “sets” it, it is displayed back in a TextView field.

So, the code associated with the button is:

pickDate.setOnClickListener( new OnClickListener() {
@Override
    public void onClick(View v) {
        showDialog(DATE_DIALOG_ID);
    }
});

showDialog(…) is a method available on an Activity Itself. It just takes an integer to help decide which dialog should actually be shown. This is decided in the onCreateDialog(…) method that gets automatically invoked when showDialog(…) is called.

Here is the code for the same:

protected Dialog onCreateDialog(int id){
    switch(id) {
        case DATE_DIALOG_ID:
            return new DatePickerDialog(this, dateListener, year, month, day);
        case ….
    }
    return null;
}

In this method, when the int passed is DATE_DIALOG_ID, a new DatePickerDialog is passed along with the values for year, month and day. Where did I set values for these? In the onCreate(…) method itself, I have done this:

final Calendar cal = Calendar.getInstance();
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH);
day = cal.get(Calendar.DAY_OF_MONTH);

Also note that a handle to a listener is expected to be given to the DatePickerDialog. I will come to this listener a little later.

I have also updated the Date - TextView with these values in the updateDate() method which is invoked in the onCreate(…) method itself.

private void updateTime() {
    timeDisplay.setText(new StringBuilder().append(hours).append(:)
    .append(min));
}

So far, what I have done is shown how to create a Dialog and set the date.

Once the dialog shows up, when a user sets the date and clicks ‘set’, the listener that is invoked in on the DatePickerDialog. The method is onDateSetListener whose handle is passed during the creation of the DatePickerDialog itself.

private DatePickerDialog.OnDateSetListener dateListener =
    new DatePickerDialog.OnDateSetListener() {
        @Override
        public void onDateSet(DatePicker view, int yr, int monthOfYear, int dayOfMonth) {
            year = yr;
            month = monthOfYear;
            day = dayOfMonth;
            updateDate();
     }
};

In this method, on the click on the dialog, we are setting the day, month, year values to the new values that the user selected and also calling the updateDate() method to refresh the TextView with what the user selected.

It is this simple.

Same thing can be done with the TimePicker as well. The only difference is that you can pass a Boolean variable to say whether you want the time in 24 hour or 12 hour pattern.

Here is the complete code for the same.



Read More..

Saturday, February 27, 2016

Android 2 3 is here and what does it bring

Android 2.3 (Gingerbread) has been released on the 6th of December 2010. While it is still a minor release, Android 3.0 (Honeycomb) would probably bring greater surprises. Atleast I am hoping that there would be the "Wow" factor with it.

Here are a few features of the Gingerbread version:
  • Updated user interface design
  • Support for extra-large screen sizes and resolutions (WXGA and higher)
  • Native support for SIP VoIP telephony
  • Support for WebM/VP8 video playback, and AAC audio encoding
  • New audio effects such as reverb, equalization, headphone virtualization, and bass boost
  • Support for Near Field Communication
  • System-wide copy–paste functionalities
  • Redesigned multi-touch software keyboard
  • Enhanced support for native code development
  • Audio, graphical, and input enhancements for game developers
  • Concurrent garbage collection for increased performance
  • Native support for more sensors (such as gyroscopes and barometers)
  • A download manager for long running downloads
  • Improved power management and application control
  • Native support for multiple cameras
  • Switched from YAFFS to the ext4 filesystem
  • An Integrated task Manager
Alongside the new platform, Google is also releasing updates to the Software Development Kit (SDK) tools (r8), Native Development Kit (NDK) and Android Development Tools (ADT) plug-in for Eclipse (8.0.0).
    The new features are simplified debug builds, integrated ProGaurd support, HierarchyViewer improvements and a preview of new UI Builder.  For a few of the reviews you can go here:
    Gizmodos Review - Android 2.3 Gingerbread Review: Better Than Fruitcake
    Techworlds review - Google Android 2.3 Gingerbread review


    Read More..