Search This Blog

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

Wednesday, 16 August 2017

Revival of Nokia : Nokia 6 launch is perfect fly way, Nokia should thanks Android


  

Nokia a Finnish company was of demolish when Microsoft purchased it. Nokia was terribly failed in the race of speedy innovation and competition. There used to be a only Nokia group which were in great number, slowly turn towards Samsung.
In 1998 alone, the company had sales revenue of $20 billion making $2.6 billion profit. By 2000 Nokia employed over 55,000 people.[34]The Nokia 3600/3650 was the first camera phone to hit the North American market in 2003. The company would go on to become a successful and innovative camera phone maker.
But after 2010, in front of competition from Google and Apple, Nokia become outdated and a lethargic market player. 


Nokia stays away from Android since android was launched. First, they try to sale their phone loaded with Symbian O.S, then Microsoft bought Nokia and run their luck with windows O.S. to shun android and iOS. None of the strategy worked for Nokia. Now Nokia have adopted world most popular mobile O.S android to turn their future. Nokia 6, the first Nokia phone with android is already a big hit in India. Nokia 6 is selling by Amazon on bases of pre-booking  

Full specifications

In the box
Your Nokia 6
Charger
Charging/data cable
Headset
Quick guide
SIM door key
Design
Colors Arte Black (limited edition), Matte Black, Tempered Blue, Silver, Copper
Size 154 x 75.8 x 7.85 mm (8.4 with camera bump)
Network and connectivity
Network speed LTE Cat. 4, 150Mbps DL/50Mbps UL
Networks GSM: 850/900/1800/1900; WCDMA: Band 1, 2, 5, 8; LTE: Band 1, 3, 5, 7, 8, 20, 28, 38, 40
Performance
Operating system Android™ 7.1.1 Nougat
RAM Arte Black, 4 GB; all other colors, 3 GB
CPU Qualcomm® Snapdragon™ 430 mobile platform
Storage
Internal memory Arte Black, 64 GB2; all other colors, 32 GB2
MicroSD card slot Support for up to 128 GB
Services Google Drive
Audio
Connector 3.5 mm headphone jack
Speakers Dual speakers
Amplifier Smart amplifier (TFA9891) with Dolby Atmos®
Display
Size and type 5.5” IPS LCD
Resolution Full-HD (1920 x 1080, 16:9)
Material Sculpted Corning® Gorilla® Glass
Pixel density 403 ppi
Brightness 450 nits, laminated
Features Sunlight readability
Camera
Primary camera 16MP PDAF, 1.0um, f/2, dual tone flash
Front-facing camera 8MP AF, 1.12um, f/2, FOV 84 degrees
Connectivity and sensors
Connectivity Micro USB (USB 2.0), USB OTG, Wi-Fi, Bluetooth 4.1
Sensors Accelerometer (G-sensor), ambient light sensor, e-compass, Hall sensor, fingerprint sensor, gyroscope, proximity sensor, NFC (sharing)
Battery life
Battery type Integrated 3000 mAh battery4

Monday, 19 June 2017

Android Kotlin – 7 reason why using Kotlin is better idea over Java

While Java is most popular language for android development. But android application can be written in any language that can compile and run on Java Virtual Machine (JVM).  End user even can’t see the difference.
Kotlin is officially introduced in recent Google IO session. Switching to Kotlin programming language is a nice idea as Kotlin is much stronger language compare to Java in many areas.
There are 10 reason to use kotlin in android development over java –


   Java isn’t a modern language


Even though launching Java 8 was the great effort to make it a modern language but at the time of writing android only support a subset of Java 9 features. Java as a whole also has some pretty well-documented language issues, including endless try-catch blocks, a lack of extend ability, null-unsafety (and that infamous NullPointerException), not to mention a lack of support for functional programming features.

     Interchangeability with Java


Kotlin strength is, it can work all alone and along with java as well. Open source content which are already written in Java can work with Kotlin with any problem

         Kotlin is easy to learn


Being a modern object oriented programming language, Kotlin is very easy to learn. Java developer will find most syntax of Kotlin similar to Java.

   Combination of Best functional and Procedural


So why should you have to choose between functional and procedural? Like many modern programming languages, Kotlin aims to bring you the best of both worlds by combining concepts and elements from both procedural and functional programming.
          

          Nice Android Studio Support


Kotlin is developed by JetBrains, the company behind IntelliJ—the IDE that Android Studio is based on. It’s obvious that Android Studio has excellent support for Kotlin. If you've installed the Kotlin plugin, Android Studio makes configuring Kotlin in your project simple.

Concise code


Class written in Kotlin is more concise compare to code written in Java for same work. Kotlin is particularly good at reducing the amount of boilerplate code you need to write, which should make coding in Kotlin a much more enjoyable experience

 Extra runtime size


 The Kotlin Standard Library and runtime will increase the size of your .apk. While this only equates to around 800KB. But it will put extra 800KB on your apk current size.

Even though Kotlin seems much better than Java but lack of official support from Google can pile up your pain. On internet there is less help available on Kotlin. I would recommend to use Kotlin along with Java. There is no need of immediate transformation of your application to Kotlin as Google didn’t make it compulsory.

Keep learning and Keep commenting …….. Wish you Good luck

Thursday, 15 September 2016

Source code of flip front camera mirror flipped video, Reverse flip front camera video

While taking video from front camera, its shows preview like a mirror. Your left ear will be shown as right in camera preview.

If you pick example from snapchat, they simply show video same as like camera preview was showing. And that feature looks good. User want the exact picture which one’s seeing in preview, if it translate it can completely change video look.

Contact me for source code, implementation help and following features

  •  Ready to use code
  • Camera preview rotation fix on most of the device
  • Android flip front camera mirror flipped video
  • Video player and Camera preview full source with ownership
  • Extra support in integrating

Email me your requirement on codeinandroid@gmail.com/abdul.tofeeq@gmail.com.


Stop front facing camera from mirroring (inverting) image programmatically?

While taking picture from front camera, its shows preview like a mirror. Your left ear will be shown as right in camera preview. Referhow to take picture from Camera and SurfaceView for camera basics.

If you pic example from snapchat, they simply show picture same as like camera preview was showing. That feature looks good. User want the exact picture which one’s seeing in preview, if it translate it can completely change image/picture look.
When you capture bitmap from byte array, you can translate it back to what was showing in camera preview. Look at code below –

Matrix matrix = new Matrix();
if (face) { // reverse flipping of image should only need to be handle for front facing camera
    matrix.preScale(1.0f, -1.0f);
}

Apply matrix to bitmap and create a new one –
Bitmap new_bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), 
bitmap.getHeight(), matrix, true); 
// bitmap is old bitmap which we created from byte array of camera stream


See how to reverse flip video taken from front facing camera. 


Monday, 18 July 2016

Evolving android, points where Google android sucks because of OEM


 I was thinking a lot lately that Google is working hard to provide user a great android experience. Google is launching new fixes on monthly basis, launching a new version almost every year with ton of new features. But if we see distribution of android version over the phone market, we will be stunned by statistics. Many android customer have outdated version of android.

Some OEM believes in concept of loading hardware and software once in a lifetime like Micromax, Chinese mobile maker while most OEM only providing update to their premium phones or say flagships.

This approach is killing Google Android. I admit providing software update to existing hardware takes lot of money which OEMs don’t want to do for cheap phones. Only flagship which meant to bind with their reputation is their priority. Unlike iPhone its very hard to bring OEM and Google at same level while providing update

Look at current android distribution. Almost 70% percent of market is occupied by Kitkat and lower version of android while Google announced a new android nougat to be launch soon. I presume only some phone with Lollipop have possibility to get update of android nougat. So again the gap will only increase over the time





Who is suffering?

Obliviously android and its user are the one who suffer most by this. Android’s team hard work and latest update are not reaching to millions of users, on the hand people are willing to move but they bound by limitations of their OEM. Eventually android suffers in the whole process

Solution!

For current market strategies, competition is so high to sell devices for android manufacture that they are not going to pay attention on hardware which can support some level upgrade for new android version. Their only purpose is to sell android phone. So one solution is customer will have to buy new android phone every year.
Second possible solution is OEM should do minimum changes in android source so that they will prepare new upgrade for their existing customers at minimum cost. But this will wipe out the creativity and diversity in android market

Continue…..


Sunday, 17 July 2016

Android Nougat Developer Preview Multi Window Support in application

Android didn't have support for running multiple activities and application in a single screen. Android phone screen was used only by single App. Even though some OEM like Samsung was supporting this on their level by customising android source code.

But now android officially supported multi window features. On handheld devices, two apps can run side-by-side or one-above-the-other in split-screen mode. On TV devices, apps can use picture-in-picture mode to continue video playback while users are interacting with another app.Lets discuss how developer has to cope with new changes

Types of  Multi-window Support 

  • Split screen Mode - In this mode, the system fills the screen with two apps, showing them either side-by-side or one-above-the-other. The user can drag the dividing line separating the two to make one app larger and the other smaller.
  • Picture in Picture Mode - On Nexus Player running Android N, apps can put themselves in picture-in-picture mode, allowing them to continue showing content while the user browses or interacts with other apps.
  • FreeForm Mode - Manufacturers of larger devices can choose to enable freeform mode, in which the user can freely resize each activity. If the manufacturer enables this feature, the device offers freeform mode in addition to split-screen mode.

Configuring Your App for Multi-Window Mode  Android Multi-window support provide attributes to customise your application 


  • android:resizeableActivity - True or False decide either you want your app to support Multi-Window
  • android:supportsPictureInPicture - Boolean value decide this feature is supported or not. This attribute is ignored ifandroid:resizeableActivity is false.
  • Layout attributes - Layout width, height can  decide how much minimum space your app required to run.You can query either your application  running in picture in picture mode or running in Mult-Window support

Tuesday, 29 March 2016

Bluetooth low energy points : Android BLE (Bluetooth Low energy) works and save power

BLE is a low energy version of Bluetooth specified in the version 4.0 [1]. Two of the lowest layers of BLE stack are Physical (PHY) and the Link Layer (LL). PHY takes care of transmitting and receiving bits. The Link Layer provides medium access, connection establishment, error control, and flow control. The upper layers are Logical Link Control and Adaptation Protocol (L2CAP), Generic Attribute protocol (GATT), and Generic Access Profile (GAP). L2CAP is able to multiplex the data channels from the above layers and provides fragmentation and reassembly for large data packets. Similar to classic Bluetooth (BT), BLE uses adaptive frequency hopping spread spectrum to access the shared channel. However, the number of hops is 43 and the channel width is 2MHz as opposed to 79 hops and 1MHz channel width in classic BT.

How BLE save energy?


BLE device can operate either in master or slave role. A master can manage multiple simultaneous connections with a number of slave devices, but a slave can only be connected to a single master. Therefore, a BLE network topology is a star. Differently from classic BT, discovery is done so that slave advertises on one or several of the three designated advertisement channels. Master scans these channels in order to discover slaves. After discovery, data transmission happens in the form of connection events in which the master and the slave wake up in synchrony to exchange frames. Both devices sleep the rest of time.

Things to know about BLE/ BLE android –


  • BLE operate on GATT/ATT profile
  • Use very less power compare to classic Bluetooth. Used for small burst of data exchange such sensors, Remote controllers
  • BLE doesn’t support streaming
  • BLE have data rate of 1 mbps but is not optimized for data transfer
  • Design for sending small bundle of data exposing state


Tuesday, 31 March 2015

RecyclerView example, Source code with onItemClickListener 

What is RecyclerView?


Android official site states “The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views ”

RecyclerView is generally used when elements changes at run time on user action or network events

You will need android-support-v7-recyclerview.jar for RecyclerView to integrate in your projects. This article will explain you a way to implement onItemClickListener in RecyclerView.

Lets implement RecyclerView steps by steps. Source code  is here in case you may want to skip theory or unable to find android-support-v7-recyclerview.jar

Steps 1- Create android xml layouts

 <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"  
   xmlns:tools="http://schemas.android.com/tools"  
   android:id="@+id/idRecyclerView"  
   android:layout_width="match_parent"  
   android:layout_height="match_parent"  
   tools:context="com.recyclerview.MainActivity" >  
 </android.support.v7.widget.RecyclerView>  

Steps 2- Create Activity and RecyclerView.Adapter

MainActivity.java

 package com.recyclerview;  
 import android.os.Bundle;  
 import android.support.v7.app.ActionBarActivity;  
 import android.support.v7.widget.LinearLayoutManager;  
 import android.support.v7.widget.RecyclerView;  
 import android.widget.Toast;  
 public class MainActivity extends ActionBarActivity implements OnItemRecycleViewClickListener {  
      RecyclerView mRecyclerView;  
      private String[] mData = { "Tofeeq AHmad", "Recycler View", "Layout managers for positioning items", "Default animations for common", "Tofeeq AHmad", "Recycler View",  
                "Layout managers for positioning items", "Default animations for common", "Tofeeq AHmad", "Recycler View", "Layout managers for positioning items",  
                "Default animations for common" };  
      @Override  
      protected void onCreate(Bundle savedInstanceState) {  
           super.onCreate(savedInstanceState);  
           setContentView(R.layout.activity_main);  
           mRecyclerView = (RecyclerView) findViewById(R.id.idRecyclerView);  
           LinearLayoutManager mLinearManager = new LinearLayoutManager(this);  
           mRecyclerView.setLayoutManager(mLinearManager);  
           //          StaggeredGridLayoutManager mStaggeredGridLayoutManager = new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.HORIZONTAL);  
           //          mRecyclerView.setLayoutManager(mStaggeredGridLayoutManager);  
           //  
           //          GridLayoutManager mGridLayoutManager = new GridLayoutManager(this, 2, GridLayoutManager.VERTICAL, false);  
           //          mRecyclerView.setLayoutManager(mGridLayoutManager);  
           mRecyclerView.setHasFixedSize(true);  
           mRecyclerView.setAdapter(new RecyclerAdapter(mData, this));  
      }  
      @Override  
      public void onItemClicked(int position, RecyclerAdapter mAdapter) {  
           Toast.makeText(this, String.valueOf(position), Toast.LENGTH_LONG).show();  
      }  
 }  

RecyclerAdapter.java
 package com.recyclerview;  
 import android.support.v7.widget.RecyclerView;  
 import android.view.LayoutInflater;  
 import android.view.View;  
 import android.view.View.OnClickListener;  
 import android.view.ViewGroup;  
 import android.widget.ImageView;  
 import android.widget.TextView;  
 public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> {  
      private String[] mDataset;  
      OnItemRecycleViewClickListener mOnItemRecycleViewClickListener;  
      public RecyclerAdapter(String[] myDataset, OnItemRecycleViewClickListener mOnItemRecycleViewClickListener) {  
           mDataset = myDataset;  
           this.mOnItemRecycleViewClickListener = mOnItemRecycleViewClickListener;  
      }  
      public static class ViewHolder extends RecyclerView.ViewHolder {  
           public TextView mTextView;  
           public ImageView mImageView;  
           public ViewHolder(View v) {  
                super(v);  
                mTextView = (TextView) v.findViewById(R.id.txt1);  
                mImageView = (ImageView) v.findViewById(R.id.imageView);  
           }  
      }  
      @Override  
      public int getItemCount() {  
           return mDataset.length;  
      }  
      @Override  
      public void onBindViewHolder(ViewHolder arg0, int arg1) {  
           arg0.mTextView.setText(mDataset[arg1]);  
           arg0.itemView.setTag(arg1);  
           arg0.itemView.setOnClickListener(new OnClickListener() {  
                @Override  
                public void onClick(View v) {  
                     mOnItemRecycleViewClickListener.onItemClicked(Integer.parseInt(v.getTag().toString()), RecyclerAdapter.this);  
                }  
           });  
      }  
      @Override  
      public ViewHolder onCreateViewHolder(ViewGroup parent, int arg1) {  
           View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list, parent, false);  
           ViewHolder vh = new ViewHolder(v);  
           return vh;  
      }  
 }  


Steps 3- To Implment onItemClickListener create one interface and attach it with adapter. RecyclerAdapter adapter already have this attach with it in step 2.

 package com.recyclerview;  
 public interface OnItemRecycleViewClickListener {  
      public void onItemClicked(int position, RecyclerAdapter mAdapter);  
 }  

Tuesday, 30 December 2014

Best practices Android Resposiveness : Using background Intent service for background job

An IntentService isn't affected by most user interface lifecycle events, so it continues to run in circumstances that would shut down an AsyncTask.

Creating a background services

Create a class RSSPullService and extends IntentService to create component IntentService



          public class RSSPullService extends IntentService {
    @Override
    protected void onHandleIntent(Intent workIntent) {
        // Gets data from the incoming Intent
        String dataString = workIntent.getDataString();
        ...
        // Do work here, based on the contents of dataString
        ...
    }
}
       
 

Define IntentService with application Manifest


Create a background work request and send it to IntentService

Create a new, explicit Intent for the IntentService called RSSPullService.

mServiceIntent = new Intent(getActivity(), RSSPullService.class);
mServiceIntent.setData(Uri.parse(dataUrl));

Call startService()

// Starts the IntentService
getActivity().startService(mServiceIntent);

Report Status from an IntentService See Google Android Article 

Download Source


Monday, 17 February 2014

Android FTP client tutorial with example of uploading, downloading and authentication with FTP server

FTP protocol is standard network protocol for transferring file. It works on peer to peer base network. In recent days I had written few articles about file transfer protocol and comparison among them to choose best. After research, research shows that FTP outperformed everything in android. So I decide to write about FTP client implementation. This tutorial will teach you
  • Android FTP client Authentication - How to connect with FTP server?
  • Android FTP client Download - How to download a file from FTP server?
  • Android FTP client Upload -How to upload a file to FTP server?

Basic requirement for this tutorial is one simple FTP server setup at your desktop. You can use file-Zilla or IIS server for this requirement.

  • Android FTP client authentication and listing file from FTP server

      /**  
       *   
       * @param ip  
       * @param userName  
       * @param pass  
       */  
      public void connnectingwithFTP(String ip, String userName, String pass) {  
           boolean status = false;  
           try {  
                FTPClient mFtpClient = new FTPClient();  
                mFtpClient.setConnectTimeout(10 * 1000);  
                mFtpClient.connect(InetAddress.getByName(ip));  
                status = mFtpClient.login(userName, pass);  
                Log.e("isFTPConnected", String.valueOf(status));  
                if (FTPReply.isPositiveCompletion(mFtpClient.getReplyCode())) {  
                     mFtpClient.setFileType(FTP.ASCII_FILE_TYPE);  
                     mFtpClient.enterLocalPassiveMode();  
                     FTPFile[] mFileArray = mFtpClient.listFiles();  
                     Log.e("Size", String.valueOf(mFileArray.length));  
                }  
           } catch (SocketException e) {  
                e.printStackTrace();  
           } catch (UnknownHostException e) {  
                e.printStackTrace();  
           } catch (IOException e) {  
                e.printStackTrace();  
           }  
      }  

  • Android FTP client download a file from FTP server – you can browse through directory saved on FTP server and can download desired file or directory. I just write code here for downloading a single file and writing it to sdcard/phone memory.

      /**  
       * @param ftpClient FTPclient object  
       * @param remoteFilePath  FTP server file path  
       * @param downloadFile   local file path where you want to save after download  
       * @return status of downloaded file  
       */  
      public boolean downloadSingleFile(FTPClient ftpClient,  
                String remoteFilePath, File downloadFile) {  
           File parentDir = downloadFile.getParentFile();  
           if (!parentDir.exists())  
                parentDir.mkdir();  
           OutputStream outputStream = null;  
           try {  
                outputStream = new BufferedOutputStream(new FileOutputStream(  
                          downloadFile));  
                ftpClient.setFileType(FTP.BINARY_FILE_TYPE);  
                return ftpClient.retrieveFile(remoteFilePath, outputStream);  
           } catch (Exception ex) {  
                ex.printStackTrace();  
           } finally {  
                if (outputStream != null) {  
                     try {  
                          outputStream.close();  
                     } catch (IOException e) {  
                          e.printStackTrace();  
                     }  
                }  
           }  
           return false;  
      }  

For browsing through directory see this Browsing Nested Directory

  • Android FTP client uploading a file to FTP server – You can upload a file to server with object of FTPClient at desired path which you need to define.

      /**  
       *   
       * @param ftpClient FTPclient object  
       * @param downloadFile local file which need to be uploaded.  
       */  
      public void uploadFile(FTPClient ftpClient, File downloadFile,String serverfilePath) {  
           try {  
                FileInputStream srcFileStream = new FileInputStream(downloadFile);  
                boolean status = ftpClient.storeFile("remote ftp path",  
                          srcFileStream);  
                Log.e("Status", String.valueOf(status));  
                srcFileStream.close();  
           } catch (Exception e) {  
                e.printStackTrace();  
           }  
      }  

Download Jar  

 

Note : Keep all methods inside background thread (i.e Asynchronous Task, Service)

 See Sambha file sharing client for android

Wednesday, 12 February 2014

Best file transfer protocol : Which to use among SMB, Socket (TCP/UDP) and FTP?



I had gone through the requirement of file transfer using peer to peer in a same network. I tried the case of server and client too because I had not any issue to run server script (in case of Socket Connection). Main purpose was to attain maximum transfer speed of data. So I tried with three most popular protocols for file transfers which are –
  • SMB – Server Message Protocols known also as sambha file sharing
  • Socket- Work on the base of client server concept
  • FTP- File transfer protocol

Comparison for performance –


Phone
Protocol
Data
Distance
Time
Max Speed
XOLO
Socket
1.3 GB
5 Meter
16 Min
1.3 MB/S
XOLO
SMB
0.7 GB
5 Meter
25 Min
0.5 MB/S
XOLO
FTP
1.3 GB
5 Meter
14 Min
1.6 MB/S

Notable Point about file transfer protocols –

  • Socket – Server scripting required for file transfer. This connection cannot be named as peer to peer
  • SMB – No scripting required for file transfer. It can read any file structure of peer computer
  • FTP FileZilla can do the trick for file transfer. No Server script required

Term and Condition – These all testing has been done between an android and a low configuration desktop (Windows 7). Both were connected to one dedicated wifi local network



Sunday, 9 February 2014

Android sambha/ JSIFS file sharing example and source code

Look at ES File explorer functionality of connecting to peer computer (either android or Desktop) and reading file structure of that device on your own device to copy content. I just implemented this functionality using SMB file sharing system in android. I will explain with source code and example. You can connect to any peer computer using its IP and password. It will allow you to read full directory of this computer. This process is called peer to peer connection.

  • Why to use Sambha File Sharing system


           For making file sharing system like ES Android file explorer which connect peer device on LAN

You will need IP and Password of that peer which you want to connect through SMB file transfer system.
Connecting android with peer using SMB file sharing -

      public void connectingWithSmbServer() {  
           try {  
                String yourPeerPassword = "administrator";  
                String yourPeerName = "abcd1234";  
                String yourPeerIP = "192.168.1.3";  
                String path = "smb://" + yourPeerIP;  
                NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(  
                          null, yourPeerName, yourPeerPassword);  
                Log.e("Connected", "Yes");  
                SmbFile smbFile = new SmbFile(path, auth);  
                /** Printing Information about SMB file which belong to your Peer **/  
                String nameoffile = smbFile.getName();  
                String pathoffile = smbFile.getPath();  
                Log.e(nameoffile, pathoffile);  
           } catch (Exception e) {  
                e.printStackTrace();  
                Log.e("Connected", e.getMessage());  
           }  
      }  

Once you connected you can browse through the file system easily and you can download any file from peer to android sdcards. Once see below code to download file from peer to android sdcard using SMB file sharing system -

      public void downloadFileFromPeerToSdcard(File mLocalFile, SmbFile mFile) {  
           try {  
                SmbFileInputStream mFStream = new SmbFileInputStream(mFile);  
                mLocalFile = new File(Environment.getExternalStorageDirectory(),  
                          mFile.getName());  
                FileOutputStream mFileOutputStream = new FileOutputStream(  
                          mLocalFile);  
                byte[] buffer = new byte[1024];  
                int len1 = 0;  
                while ((len1 = mFStream.read(buffer)) > 0) {  
                     mFileOutputStream.write(buffer, 0, len1);  
                }  
                mFileOutputStream.close();  
                mFStream.close();  
           } catch (MalformedURLException e) {  
                e.printStackTrace();  
                Log.e("MalformURL", e.getMessage());  
           } catch (SmbException e) {  
                e.printStackTrace();  
                Log.e("SMBException", e.getMessage());  
           } catch (Exception e) {  
                e.printStackTrace();  
                Log.e("Exception", e.getMessage());  
           }  
      }  

Note : Keep all methods inside background thread (i.e Asynchronous Task, Service)


You need to add one JSIFS Sambha jar file. Enjoy


Android News and source code