Connect to Active Directory from Android application - android

I need to connect to Active Directory from Android application. I woudn't like to create Active Directory wrapper - web service or something like that for this task. Are there any standard libraries for that?
Question looks similiar to Connect to Active Directory from iOS application except operating system.

Related

Access protected UNIX domain sockets from Android app (using root)

I need to access a UNIX domain socket from my Android app. Its file is located in /dev, so I need root permissions to open it. My phone is rooted, so gaining this permissions is not a problem. However, I failed to find a way to access this socket from root and forward the communication to my app.
AFAIK, the only way Android apps can get root permissions is through the su tool, so I need to find a native tool (already installed in the phone) that can make a bridge between STDIN/STDOUT and UNIX domain packets (so that my app can control the communication). The typical tools for that purpose are nc and socat. The former is available through busybox, but that version does not support UNIX domain sockets. The latter is not available at all. I'd rather avoid modifying the system partition to install a different tool.
My app could also launch a script that communicate with that socket from su directly without the need to forward the communication to my app, but again, I found no way to write such a script without the previously mentioned tools.
Is it possible to do what I want without installing/developing a native binary tool?
Maybe it is possible to do something with iptables/netfilter, but that does not seem to support this kind of sockets.
EDIT: well, I ended up developing a native binary executable which opens the Unix domain socket as root, and forwards it to the Java part using another Unix domain socket (created by the Java part). There is a hidden constructor for LocalSocket which takes a file descriptor and uses it as the opened socket. The biggest challenge was to find out how to compile a native executable with Android studio (not a library), but this answer helped a lot.

How to put file from android app to pc in LAN network

I have a little problem with my android app. I'm developing an android app that should read .txt file from PC, and path is "E:/Sharing/hello.txt". I already shared that folder on PC. How can I get that file and read it on my android app. Is there any solution, or someone have example how to do that?
It can do in many ways here:
You need to write 2 app, one in android [as client], another on in desktop [as server]
this way, you need to connect your android to server app, and let server app handle all about find files and transfer to your android app
Easier way, you just need to use some Data's storage service, such as Google Drive, Dropbox, Microsoft OneDrive, etc.
to let them auto sync all your file and put it in their site, then, you just need to (install their app in your android or) download your file directly from their site.
Easiest way, from your desktop, just send file to your android's register email. after that just download it from Google Gmail
I suggested, 2 and 3 (even if it doesn't relate to programming) because it is easier than 1 alot, and many
people also accepted to used it in real-life

Should I be able to create /etc/myApp directory on Android?

I'm porting a C++ Linux application to Android using NDK and testing using the emulator. The application tries to create an /etc/myApp directory and fails because the component /etc does not have the necessary write file system permissions required to create.
Should my application be able to create such a directory? I used adb to inspect and try to make the directory from the shell and it fails too:
mkdir failed for myApp, Read-only file system
Does the file system being read only in adb mean it is also read-only for my application?
Can my application expect to create this directory and if not, is there another location that is more appropriate?
No, you should not be able to do that. Android apps are not permitted to write to system directories.
You should probably create this directory within your app's private storage area. Generally it is best to discover the path of that from Java (don't hardcode it) and then pass it through to the native side.
Depending on your needs for the file, the ExternalStorage might also be an option, especially during development where you might need to easily modify it manually - though keep in mind that others things will be able to change it there, too. Again, you should determine the path on your particular device in Java and then pass that through to the native code.

Listing peer (desktop) directory structure on android device on same wifi Network

I am working on concept of sharing file between peer to peer. I have one desktop and Android connected to same wifi network. Using many application we can show file structure of android on desktop (i.e Airdriod without running scripting on desktop). But my issue is just to create opposite. I want to show file structure of Desktop at android side so that user can copy element directly to one's Android phone.
Finally i met with SMB file sharing system and able to browse directory of Peer computer through my android application. This also help in creating peer to peer communication. Thanks goes to tutorial sambha file sharing

Cant find my phonegap app in the android file system after installing the apk file

Im currently in the process of byuilding an app with phonegap on android.
I Prepared a "spoof app " with tests of some functionnalities i wanted to try before starting to develop fully.
I built my app and signed it so i may install it on my phone with the apk.
The problem is , my app works fine but i cant find the file system of the app in any of the devices i tested the app on. I wanted to retrieve the SQLite database or a file i created but i cant because i cant find the filesystem of the app in the device.
Is there anyway other than rooting the device to see my app in the phone filesystem when plugged with usb?
Or is there any way i can retrieve easily the databases my app created on the phone?
EDIT: my devices dont have SDCARDS and doesnt support SDCARDS either.
PROBLEM SOLVED
Since i found out that i would have to root the phone or the tablet to acess the filesystem i review my app functionnalities and i found out i could create a foler on the phone with phonegap , but still i couldnt see it.
I then opened the DDMS perspective in eclipse and looked throught the filesystem and found out that the folders i saw in my phone were in the mnt folder, in the sdcard directory. (mnt/sdcard)
I then used the filesystem acess of phonegap to create a directory on my phone.
fileSystem.root.getDirectory("**/mnt/sdcard/com.seventest.com**",{create:true, exclusive: false},gotDir,fails);
So now i can access a directory and push anything in it i need to access for my app to work with.

Categories

Resources