Showing posts with label Android Developers. Show all posts
Showing posts with label Android Developers. Show all posts

Flash recovery on Samsung Smartphones

January 10, 2015 Posted by WithU Technologies , ,

How to flash recovery on Samsung Smartphones


As we know that every phone comes with a basic stock recovery application along it and that can be found during the booting of phone by pressing Power button + Home key + Volume Up button.
But they have limited functionality features within them. As they only feature functions to manually flash official updates and clear your phone's cache.


The flashing of a recovery file is specially required when you bricked your Android smartphone. Here we learn the method to fix even a bricked Samsung android device with ODIN.

You can also flash custom recovery software. But I recommend to do it after rooting your phone for better results. For a detailed tutorial on Android rooting you can refer to this link:

How to root Android Device.

There are two methods depending upon you devices manufacturer:

• Fastboot method through ADB.
• ODIN method for Samsung devices

We discuss both the methods and their steps, which helps you to choose the perfect method to flash recovery on your device according to your device.

For the first method Click on the Following link:

How to install Custom Recovery on Android


This method is especially recommended for all the Samsung Handsets in which the device did not restarts into bootloader or fastboot mode.

Requirements:

          Samsung Android USB drivers here





Important things to remember

  • Do not forget to Backup your phone.

  • Download the correct and latest Odin version.

  • Install the Latest Samsung USB Driver

  • Keep in mind that , Most of Samsung phones are different and each one requires various procedures to rooting & flashing with custom ROMs

Download Custom recovery files

There are generally two important and efficient software as custom recovery application for Android and they are:

  • CWM (ClockworkMod)

  • TWRP (Team Win's Recovery Project)

Downloading the software

Download the latest version of either CWM or TWRP from their official website links given below (we prefer CWM, but both work equally well). For CWM go to this website, find your device, and download the file for it:





For TWRP go to this website, click on "Get TWRP for your device" and type your device's name for which you are downloading the file:

Assumptions:

  • You already completed the rooting process that means you know how to check USB debugging option and how to connect your device with your PC with the help of your phone's connectivity drivers. If not then refer to this post, How to root your Android device.

  • The mobile Connectivity drivers are already installed in your PC and your device is already  tested and connected once with your PC.

  • Connect your device with your PC with the USB data cable.

  • Check the USB debugging option.

  • You already converted the .img file into .tar format or .tar.md5 file format.

(As we know in Samsung ODIN flashing the importance of .tar and .tar.md5 formats are very much. And in general the custom recovery files such as, CWM and TWRP are comes in .img format which are not flashable through ODIN. To convert those custom recovery files and also other files in .img format to .tar and .tar.md5 format follow the following link)

So, let's start the process to flash custom recovery in Samsung mobiles.

  • First of all Open the ODIN software.

  • Switch off your Samsung Android device. (If it is not bricked yet :))




  • Restart it in Downloading mode or  ODIN mode by pressing the following key combination :


Volume Down + Power Button + Home Button




  • Press Volume UP button to continue.

  • After the phone opened up in downloading mode, connect your Samsung android device with your PC with the USB data cable.




  • After the connection takes place you will observe that on the ID:COM indicator the first port is enlighten with light blue colour.




  • After that Check the Auto Reboot option and F:Reset Time option.




  • Then Click On AP or PDA (Depending upon your ODIN Version) to select the custom recovery file which is needed to be formatted.




  • After the file loaded into ODIN, then Click on Start button which will initiate the flashing process and if everything goes perfectly then your device will be flashed with a new custom recovery software.




  • Then your device will automatically restarted with new custom recovery software.


  • To get into your new custom recovery software follow the steps given below:



    • After the completion of flashing process switch of your device and start it again by pressing:


      Volume UP + Home Button + Power Button

       


    • Or you can alternatively type the following code in the command prompt window to reboot your device in Recovery mode. (For info on this Click on this link: How to flash custom recovery)


      adb reboot recovery


And at last you have your own preferred custom recovery with advance functions to do.

Hope this tutorial helps you to resolve the issue regarding the flashing of recovery on Samsung Android smartphones.If you face any problem regarding this tutorial then feel free to ask us below in the comment box.

How to create Android Clock Widget

December 25, 2014 Posted by WithU Technologies , , ,

Create an Android Clock Widget


Today we are going to create an Android clock widget with the help of Android Studio IDE. This is a beginner’s Android app development project. Though this is not an app, but to learn the process of android app development, a better start is with android widgets.

Assumptions


Before heading towards the widget development process, we need to ensure that you already completed certain steps which are required to start this project and they are:

  1. Android Studio IDE and SDK tools download and installation.

  2. Basic java knowledge, which can be easily gathered from our post named: Android App Development with hello world project (Though it is not mandatory as we also discuss those java things here)


(If you want to learn about the steps above, then just click on them and they will redirect you to their respective step by step description)

Step 1. Creating a .9png file



  • Open your Adobe Photoshop and create a new image background with following values:

  • Image Height: 1-1.5 CM

  • Image Width : 2-3 CM


And create a simple image like this

  • Go to Android Asset Studio

  • Choose your image and customize it according to your needs.

  • Download the zip file and extract it which contain a res


 

Step 2. Creating a new project in Android studio IDE



  • Open Android Studio IDE.


Quick start window

  • Click on New project and Name it. Select the project location and Click Next.


Minimum sdk

  • Select the minimum SDK. (I recommend to set it up to Android 4.0 Ice Cream sandwich).


add no activity

  • Select Add no activity in the next window and Click next.


Configure widget

  • Name your activity without any space and I recommend to name it with lowercase letters.

  • Click on Finish. Then the Android studio build the project and load the components of the project so it may take few seconds.


Let me remind you that today we are going to create a basic widget which will show you the current time on your Android device Home screen.

Step 3. Editing the Widget layout



  • To create a new widget java class, follow the path given:


Your application name > src > main > java(Right Click on java and Click on NEW) > Widget > app widget.

new widget

  • Name your app widget and Click on Finish. (It automatically creates all the required files which are able to run a widget on your Android device home screen. The limitations of default widget files are:


- They contain default values especially for the layout, which are needed to be recoded.

-  They did not feature the .9png backgrounds, as they are defaulted by some colour values for  background.

-  And Most importantly the widget does not have any function by default, to do. That is the java class is functionless. So, it only demonstrate in the home screen as a colour patch if started.

 

So, first of all we have to edit the layout file. You can edit it according to your wish by changing the text size, colour and also by changing the alignment, gravity and padding of the widget.

  • Open the layout file through the following path:


         ClockWidget\app\src\main\res\layout\clock_widget.xml

(The application name and activity name will vary in your case if you changed both of them during new project creation)

  • Change the android:background by adding the drawable .9png images

  • Now the .9png is to be needed, so we need the file which was downloaded in STEP 1, which contain res folder.

  • Open that res folder and copy all the drawable files.

  • Now, navigate to your project location and then go to the following path in your computer explorer:


                                       ClockWidget\app\src\main\res

 

drawable files

  • Paste all the drawable files inside the res folder of your project.

  • Save all the files in Android studio and re-open the project.


all drawable files

  • Now, you have all sizes of .9png files which are ready to be supported in any android device.

  • You can also edit the values from our project. The layout file code are given below.






 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="@dimen/widget_margin"
android:background= "@drawable/clockwidget" ><TextView
android:id="@+id/appwidget_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/appwidget_text"
android:textColor="#ffffff"
android:textSize="40sp"
android:textStyle="bold|italic"
android:layout_gravity="center_horizontal|center"
android:layout_marginTop="10dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:shadowColor="#ff6a1aff" /></LinearLayout>

 





  • Now you have to edit the widget update provider file and it is generally named as Yourapplicationname_info

  • Navigate to the following path:


ClockWidget\app\src\main\res\xml\clock_widget_info.xml

  • Change the value of android:updatePeriodMillis="1"


Step 4. Editing the AndroidManifest.xml file

Moving on to our next step where we code the AndroidManifest.xml file, where we declare a broadcast receiver function which will process the Clock widget updates. By default the functions were already created by Android studio widget creator, but still you have to modify and add few items which are can be checked out from the following image or from the code given below.

android manifest
The code is given below which you have to type it by yourself if you really want to learn Android app development.




 
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rjchakraborty.clockwidget" ><application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" ><receiver android:name=".ClockWidget"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter><meta-data
android:name="android.appwidget.provider"
android:resource="@xml/clock_widget_info" />
</receiver>
</application></manifest>

 




 

 Step 5. Adding functions to our widget


This is the most important function in the whole process, as by now you are only editing the pre setuped files with default values.But now you have to add functions to the widget to work it as a Digital clock and for that, you have to add a bunch of codes to your java file. Get started.

  • Navigate to your project java file from the following path:


ClockWidget\app\src\main\java\com\example\rjchakraborty\clockwidget\ClockWidget.java

(The application name and activity name will vary in your case if you changed both of them during new project creation)




 

java for clock widget

  •  The code for the java file are given below. So, it would be better if you learn first and type those codes by your own hand. Copy-pasting is a easier way out, but it is not the way to learn.






 


package com.example.rjchakraborty.clockwidget;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.widget.RemoteViews;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;

/**
* Implementation of App Widget functionality.
*/
public class ClockWidget extends AppWidgetProvider {

@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {

Timer timer = new Timer();
timer.scheduleAtFixedRate(new time(context, appWidgetManager), 1, 86400000 );
}

private class time extends TimerTask {

RemoteViews remoteviews;
AppWidgetManager appWidgetManager;
ComponentName clockWidget;
DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM, Locale.getDefault());

public time(Context context, AppWidgetManager appwidgetmanager) {
this.appWidgetManager = appwidgetmanager;
remoteviews = new RemoteViews(context.getPackageName(), R.layout.clock_widget);
clockWidget = new ComponentName(context, ClockWidget.class);
}

@Override
public void run() {
remoteviews.setTextViewText(R.id.appwidget_text, "TIME  " +format.format(new Date()));
appWidgetManager.updateAppWidget(clockWidget, remoteviews);
}
}}


 




Though the layout used by me is not that good as the app is only created for experimental purpose. You can change the look of the widget by editing the layout file ad also by changing the .9png backgrounds.

 

Clock widget

Optional



  • Navigate to the following path in Android studio:


             ClockWidget\app\src\main\res\values\strings.xml

strings

  • Generally the string file is auto created by default but you can change the names as per your wish, but that was not necessary.


That's solve for this project. Try it and made it more stylish then the clock widget shown here.Feel free to ask us questions and we will be more than happy to help you as much as we can.

 

 

Android App Development with Hello World Project

December 23, 2014 Posted by WithU Technologies , , , ,
This is our second post on Android app development which is the basic of Android app development. Every Android developer start the app development course with this project. So, learn it carefully because it is the basic of Android app development.

Though we made this app a little bit advanced as it features a pop out message within a small window and this feature is known as Toast.

What is Toast?

Toast

A toast provides simple feedback about an operation in a small popup window. Toasts would automatically disappear after a timeout.

Before heading towards the Hello world project development, we assume that a certain step is already completed by you and that is:

So, let’s start our First Android Application.

  • Open Android Studio IDE.


Quick start window

  • Click on New project and Name it.


New project

  • Select the project location and Click Next.


minimum sdk

  • Select the minimum SDK. (I recommend to set it up to Android 2.2 Froyo).

  • Select Blank activity in the next window and Click next.


Activity

  • Name your activity without any space and I recommend to name it with lowercase letters.

  • Click on Finish. Then the Android studio build the project and load the components of the project so it may take few seconds.

  • A Basic structure is already created by Android Studio and now we have to add the function which we want to do from the application.


Let me remind you that today we are going to create a basic application which will say "Hello" along with your name in a popup window after you type it in the box

First, we have to change the string.xml file:

  • From the Navigation bar on the left side, navigate to the following path-


Your application name -> res -> values -> strings.xml

strings before

  • By default the above strings were written on the box


Strings after

  • Change it to the code shown on the picture above.


For the Layout design of the app we need following components:

  • Android screen layout

  • TextView

  • EditText

  • Buttonactivity main


So, to add those with orientation and dimension follow the steps shown below:

  • Navigate to the following path through the navigation bar on the left side.


Your application name -> res -> layout -> activity_main.xml (The name of the xml file and your application name will vary as it depends on the name you typed during new project creation)

  • Edit and code your main.xml layout file as per the picture shown: (I'll also give it as CODE, but don't just copy-paste)








<?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:orientation= "vertical" >

<TextView

android:text="@string/hello_world"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

/>

<EditText

android:id="@+id/name"

android:layout_width="fill_parent"

android:layout_height="wrap_content" />

<Button

android:id="@+id/tap"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text= "@string/tap"/>

</LinearLayout>






 

I add the codes in a simple copy paste format, but don't just copy and paste them to your code editor, as in that way you didn’t able to learn Android app development. So, it will be better for your learning process that you type the codes by yourself. Be careful about the cases as java is a case sensitive language i.e. android and Android resembles different meanings in java.

 

Now we have to edit the java file. The java file holds the function of your app.Let me introduce you to a few functions from our Hello World app java codes.

import

  • The import word along with the android and particular function name signifies that it is importing certain functions from library as per your need.


 

public class

  • In java classes are divide into three and they are Public class, Private class and Protected class. Public class means that the function under that class is accessible by anyone.


 

button id

  • This function will finds the Button which was added to your layout by its ID which is "tap" in our example.Open the layout file and you would find the button layout id is denoted as "tap". You can change it to anything, but keep it short.


 

Button function

  • This function tolds that when the user tap the button it will respond by the do something function.

  • In reply of tapping or pressing the button it will show the word typed in the Edit Text layout for a certain duration called as Toast.LENGTH_LONG;

  • It shows the Character sequence by adding the word side by side.

  • "Hello " + name.getText() +"!";        It will Show Hello, you can change it to Hi or something else you want then it get the text which was typed by user and then it ends with an exclamation mark.

  • Toast toast = Toast.makeText(context, text, duration);toast.show();           It setup the context text and duration and show it in a popup window.


To edit the java code follow the following steps:

  • Navigate to following path:


Your Application name\app\src\main\java\com\example\rjchakraborty\helloworld\main.java    (The application name, username will vary)

  • Type the full code given below and careful about case sensitivity.






 


import android.widget.Toast;import android.view.View.OnClickListener;import android.content.Context;

import android.view.View;

EditText name;

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

// Capture our button from layout

Button button = (Button)findViewById(R.id.tap);

// Register the onClickListener with the implementation above

button.setOnClickListener(taplistener);

}

// Create an anonymous implementation of OnClickListener

private OnClickListener taplistener = new OnClickListener() {

public void onClick(View v) {

long id = 0;

// Do something when the button is clicked

try {

name = (EditText)findViewById(R.id.name);

Context context = getApplicationContext();

CharSequence text = “Hello ” + name.getText() +”!”;

int duration = Toast.LENGTH_LONG;

Toast toast = Toast.makeText(context, text, duration);

toast.show();

}

catch(Exception e) {

Context context = getApplicationContext();

CharSequence text = e.toString() + “ID = ” + id;

int duration = Toast.LENGTH_LONG;

Toast toast = Toast.makeText(context, text, duration);

toast.show();

}

}

};

}


 




 

  • After completion save the project from File-> Save all   or   ctrl+S.


AVD manager icon

  • Open your AVD Manager from the icon highlighted above with yellow and launch the Android Device.


AVD manager

  • After the startup Completion of your virtual android device Click on Run 'app'   or   Shift+F10.

  • If there were no error throughout the app, then the app will be installed on your virtual device and launched.


Hello world app

  • Now test your first Android app. Hope you like it!.


If any error persist during the process, feel free to ask us below in our comment box. For more posts on Android and Android development project Check out our updates under the Android Modifier menu.

 

Click to download the full project developed by RJ Chakraborty. The Link is given below:

Hello world app

 

 

 

 

 

How to download and install Android Studio and SDK tools.

December 22, 2014 Posted by WithU Technologies , , , ,
What is Android?

Basically android is an operating system which generally runs on smartphone and other mobile devices.

Android is a Linux based operating system developed by Google. Android is Unique as Google developed it as a free Operating system and manufactures used them on their devices without any cost. Even anyone can develop android and also the Google play application helps to host your app on Google play and android users will download it from there.

  • Every day more than 1 million new Android devices are activated worldwide.

  • Easily optimize a single binary for phones, tablets, and other devices.

  • 5 billion Downloads a month and growing.

Nowadays Google also developing Android Wear devices which are very portable like Android glasses and watches.



Now let’s come to the topic which is to be discussed here, i.e. Android application development.

  • First of all to install Android studio, you need to install the latest version of Java Development Kit.

For Android application development we need a package which is easily downloadable from the Google Android developer website. The link is given below.

Download android studio

Android Studio package contains:

  • Android Studio IDE

  • Android SDK tools

  • Android 6.0 (Marshmallow) Platform or the latest version which android updated later.

  • Android 6.0 emulator system image with Google APIs and many other system image which you need to run the Android virtual device on your PC.

But even after downloading and installing this package, you need to download other platforms, build tools, images etc.

Installing Android studio IDE



  • First of all you need to unzip the Android studio downloaded package.

  • Following files are to be there inside the package, check them out.

File contains

  • Open the Android Studio folder and double click on android-studio-bundle-(version) setup file.

  • Then follow the setup instructions.

  • Changing the destination directory instructions:

Make a new folder in other than your root directory of operating system and rename it to android studio (Use lowercase letters).

[As in case your computer Operating system crashed and it needed to be formatted, then also the files were still safe with a huge contents on any other directory]

  • Choose that folder during destination folder selection in setup wizard and Click Next.

Extracting files

  • Click Install and setup will start to extract the bundle files.

  • Uncheck the Start Android Studio box and Click Finish


Downloading and Installing the Android SDK tools and Platforms


Before we start the process let me know you that Android SDK is something like a download manager which collects all the required tools and platforms direct from the Google and make the downloading procedure with an ease. You did not have to download each and every files shown in that sdk manager as it depends on the app development motive of the developer. For example if you want to test your app on the older version of android to improve the platform compatibility then you can download the older platform packages. So it depends on you. So, it solely depends on you, but still I made a checklist of downloads which you really needed for a basic app development process.

       Packages needed to be downloaded:

  • Download the latest version of Android SDK tools along with build tools and platform tools.

  • Download Android 4.2.2 – Android 6.0

  • On Extras – Download Android Play services, Google USB Driver, Google Web Driver and Intel x86 Emulator Accelerator, Google Repository, Google Play services.

       Steps to be followed:

As we know that we change the directory path during Android Studio installation. So make sure that the sdk path is also to that directory of android studio.

Quick start window

  • Launch the Android studio IDE and Click on Configure and then Click on SDK manager to open it.

Android sdk manager

  • Check the files which you need for your Android development package as per above suggestions.

  • For emulator it is advisable to download the Intel Atom System image. Intel atom System Image emulator is faster than the ARM based emulator.

  • In case of platforms, there is no need to download the Android TV and Android Wear system image, if you are not going to develop apps for TV and wearable Bands supported by Android OS.

  • In case of build tools, latest version is recommended to install.

Downloading package

  • Click on install Packages after the selection. Accept the license agreement and click Install.

  • One by one the packages were downloaded to their respective directory. This process may take some time, depending upon your Internet speed.

  • After the completion of the download task close the SDK Manager window.

  • Restart the Android studio IDE.

And your Android studio is ready for app development. So enjoy developing new apps and for more detailed instructions on app development.