Upgrading your Android Jellybean 4.2.1 into KitKat 4.4.2 in Samsung galaxy s4

Prerequisites for Upgrading to Android 4.4.2 Kitkat in Samsung Galaxy s4


The article explains several steps involved in upgrading your Android Jellybean OS to  Android 4.4.2 KitKatin your samsung galazy s4 smart phone ,But, beforeyou flash the firmware manually, you should be aware of the following:


- Have a proper back-up of all important data on the device,so on failure you can reflash the data .
- The handset must have at least 80 percent battery power so there will not be any crash during up gradation .
- The USB drivers for the Samsung Galaxy S4 must be installed on the computer and USB Debugging must be enabled.
- After flashing the firmware, any installed custom ROM will be lost.
- Custom recovery, such as ClockworkMod Recovery or TWRP, will also be lost.
- The Android 4.4.2 KitKat XXUFNB7 firmware is only for the Galaxy S4 with the model number GT-I9500. Do not try this on any other Galaxy S4 model.


Here are the firmware details:
PDA: I9500XXUFNB7
CSC: I9500OLBFNB4
MODEM: I9500DXUFNB2
Version: Android 4.4.2
Build date: Feb. 28, 2014
Regions: Malaysia, Indonesia, Philippines, Singapore, Thailand, Vietnam
CAUTION: You do this at your own risk, we are not responsible for any dammage that is caused to your device due to these operation, our aim is just to share the information
Step 1: Download the firmware package and extract the zip file. You will get a .tar.md5 file and along with other files. [Download links 12]
Step 2: Download Odin v3.09, and extract the zip file. You will get Odin3 v3.07.exe along with  other files.
Step 3: Run Odin3 v3.09 as an Administrator.
Step 4: Switch off the Galaxy S4 and boot it into Download Mode by pressing and holding Volume Down, Home and Power buttons.
s

Step 5: Connect the Galaxy S4 to the computer via the USB cable and wait until a blue sign appears in Odin.
Step 6: Click on the AP button in Odin and select the .tar.md5 file that was extracted in Step 1.
- Click on ‘CP’ and select file with ‘MODEM’ in its name. Ignore this step if there is no such file.
- Click on ‘CSC’ and select file with ‘CSC’ in its name. Ignore this step if there is no such file.
- Click on ‘PIT’ and select the .pit file. Ignore this step if there is no such file.
Step 7: In Odin, ensure that the Auto Reboot and F. Reset Time options are checked. The re-partition check box should be checked only if a .pit file was chosen in the previous step.
Step 8: Now, click on the Start button in Odin to begin the installation process.
Step 9: After the installation is complete, the device will restart automatically.
Step 10: Once you get the Samsung logo on the home screen, you can unplug the device from the computer and close Odin.
You are done with upgrading your old Android Jellybean OS of your Samsung galaxy s4 into brand new Android KitKat 4.4.2 OS.


Reading and writing data from and into a file in Android using java

This Article will give complete information about reading and writing data from and into a android file system , Article also provides the required functions to porform these operations, so the user can directly use those functions in his/her program  .



Writing Files to Internal Storage

public static void writeFileInternalStorage(String strWrite, Context context,String fileName) 
            {
                    try 
                    {
                             // Check if Storage is Readable 
                            if (isSdReadable())   // isSdReadable()e method is define at bottom of the post
                            {
                                    String smsfilename = fileName;
                                    FileOutputStream fos = context.openFileOutput(smsfilename,Context.MODE_PRIVATE);
                                    fos.write(strWrite.getBytes());
                                    fos.flush();
                                    fos.close();
                                    
                            }
                    } 
                    catch (Exception e) 
                    {
                        // Your Code
                    }
            }




Writing Files to SD Card




public static void writeFileOnSDCard(String strWrite, Context context,String fileName)
            {


                    try 
                    {
                            if (isSdReadable())   // isSdReadable()e method is define at bottom of the post
                            {
                                    String fullPath = Environment.getExternalStorageDirectory().getAbsolutePath();
                                    File myFile = new File(fullPath + File.separator + "/"+fileName);

                                    FileOutputStream fOut = new FileOutputStream(myFile);
                                    OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);
                                    myOutWriter.append(strWrite);
                                    myOutWriter.close();
                                    fOut.close();
                            }
                    }
                    catch (Exception e)
                    {
                            //do your stuff here
                    }
            }



Reading files from Internal Storage


public static String readFileFromSDCard(String fileName,Context context)
            {
                        String stringToReturn = "";
                        try 
                        {
                                if(isSdReadable())    // isSdReadable()e method is define at bottom of the post
                                {
                                        String fullPath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "/"+fileName;

                                        InputStream inputStream = context.openFileInput(fullPath);
             
                                        if ( inputStream != null ) 
                                        {
                                                InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
                                                BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
                                                String receiveString = "";
                                                StringBuilder stringBuilder = new StringBuilder();
                 
                                                while ( (receiveString = bufferedReader.readLine()) != null ) 
                                                {
                                                        stringBuilder.append(receiveString);
                                                }
                                                inputStream.close();
                                                stringToReturn = stringBuilder.toString();
                                        }
                                }
                        }
                        catch (FileNotFoundException e) 
                        {
                                    Log.e("TAG", "File not found: " + e.toString());
                        }
                        catch (IOException e) 
                        {
                                Log.e("TAG", "Can not read file: " + e.toString());
                        }
    
                        return stringToReturn;
            } 

Reading Files from SD card



public static String readFileInternalStorage(String fileName, Context context)
            {
                    String stringToReturn = " ";
                    try 
                    {
                            if(isSdReadable())   // isSdReadable()e method is define at bottom of the post
                            {
                                    String sfilename = fileName;
                                    InputStream inputStream = context.openFileInput(sfilename);
             
                                    if ( inputStream != null ) 
                                    {
                                            InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
                                            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
                                            String receiveString = "";
                                            StringBuilder stringBuilder = new StringBuilder();
                 
                                            while ( (receiveString = bufferedReader.readLine()) != null )
                                            {
                                                    stringBuilder.append(receiveString);
                                            }
                                            inputStream.close();
                                            stringToReturn = stringBuilder.toString();
                                    }
                            }
                    }
                    catch (FileNotFoundException e) 
                    {
                            Log.e("TAG", "File not found: " + e.toString());
                    }
                    catch (IOException e) 
                    {
                            Log.e("TAG", "Can not read file: " + e.toString());
                    }
    
                    return stringToReturn;
            }
            

Function checks the readability of a file system


public static boolean isSdReadable() 
            {

                    boolean mExternalStorageAvailable = false;
                    try 
                    {
                            String state = Environment.getExternalStorageState();

                            if (Environment.MEDIA_MOUNTED.equals(state))
                            {
                                    // We can read and write the media
                                    mExternalStorageAvailable = true;
                                    Log.i("isSdReadable", "External storage card is readable.");
                            }
                            else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) 
                            {
                                    // We can only read the media
                                    Log.i("isSdReadable", "External storage card is readable.");
                                    mExternalStorageAvailable = true;
                            } 
                            else
                            {
                                    // Something else is wrong. It may be one of many other
                                    // states, but all we need to know is we can neither read nor
                                    // write
                                    mExternalStorageAvailable = false;
                            }
                    } catch (Exception ex) 
                    {

                    }
                    return mExternalStorageAvailable;
            }
Proudly powered by Sacnorth Media