Android Network Neighborhood - Jcifs-ng
Uploading or downloading file at local network between Android and Windows by using smb socket.
Android app can use Jcifs library to access file which is in the Windows system. But Jcifs only support smb 1.
If Windows system only support smb2 or smb3, we must use other library, like smbj or jcifs-ng.
Because smbj library just for Android SDK Platform 26 (Android O, Android 8), so this article used jcifs-ng to implement.
Step 1: Import Jcifs -ng
In Jcifs-ng website,add as follow in build.gradle
1 | <dependency> |
also change to
1 | android { |
Step 2: Access Remote File
1 | String userName = "user"; |
As mentioned above, we can access file at the local network, but Jcifs-ng support smb3 partially.
Android Network Neighborhood - Jcifs-ng
https://nickcarter9.github.io/2019/04/09/2019/2019_04_09-jcifs_ng/