Android LDAP authentication (UniboundID) - android

I haven't found any samples or turtorials on how to do it so I'm asking here, for a native android app I need the user to login using his SamAccountName and password. First I need to check wether the user exists and then query wether he is inside a group so that he has the rights to use the app.
If any of you guys have sample code or a guide on how to do it would be appreciated.
I'm using android studio 2.3 with gradle 3.3.
Edit the basic thing I want to do is authenticate make sure the credentials of the user are ok then proceed to my mainactivity, I'm also new to active directory in general so any help regarding android and LDAP authentication is welcome.

STEP 1 : Download the UNBOUNDID from github or from here here.
STEP 2 : AFTER DOWNLOADING EXTRACT THE CONTENT.
STEP 3 : OPEN THAT FOLDER AND COPY JAR HAVING NAME unboundid-ldapsdk.jar.
STEP 4 : Open your android project and paste it inside the lib folder just like in the screen shot.
STEP 5 : Now right click the jar file and at the bottom there is a option Add Library.
STEP 6 : You are done enjoy using the library's functions and methods.
also you can take a reference from here.

Related

How to customize specific element in Firebase AuthUI

I am trying to customize the firebase AuthUI interface in order for it to fit with my background image.
Partially , I solved the problem using the solution provided here: How to customize firebase auth ui
Unfortunatelly , I can't find the attribute I need to modify in order to modify the color of the text in the Number Authentification function?(The one that says "By tapping "Verify Phone Number" ... ")
Can somebody help me with the name of the attribute I need to modify? I am developing an Android app in Android Studio using Kotlin.
Since the firebase-auth-ui is just an open source project by the Google its source code is provided on Github. So, the best way to your problem would be to pull/clone the github repository of firebase-auth-ui for app (Android I am assuming).
The link to their repository is : https://github.com/firebase/quickstart-android/tree/master/auth/app
Just clone it or download zip file of it. Change it according to your own UI needs and then upload it to github or directly link it to your project.
The process is long but will assure you a quality app.

how to use htmlunit with my android project

I have downloaded htmlunit 2.11 zip. i have extract it. then i have tried to paste them in my project's libs folder. from the libs folder i have added them in build path. then i get this error, while i was trying to run my app
conversion to dalvik format failed with error 1
then, from stackoverflow i found that, one said to delete xalan xercesImpl xml-apis.
i deleted them. but getting this error:
Error generating final archive: Found duplicate file for APK: about.html
error message also showed that which files are conflicted. they are jetty-http jetty-io jetty-util jetty-websocket then i run my app again. this time it shows some warning. i have ignored them. but my app crash saying that classNotFound
by the way, i have also deleted httpclient jar. because one said that httpclient is already built in android.
this is my problem. Now, can anyone help me? i really want to use htmlunit in my app
Edited:
it will be very helpfull if you show me the steps, 'how to add htmlunit in my project'
Edited 2:
mainly i have a link, which i have get after login (i have login through web view) this link give me a simple page. in that page there is a textarea and a submit button. and there are some javascript too (i think these javascript run, when i press the submit button). i can do it through webview, but for some reason i don't want to use webview. whene i press submit button, it deliver the value of textarea and some value of hidden field with existing cookies(which are get when i logged in through webview) Post method. i need to do this without webview. now is there any other option beside htmlunit ?? i heard about HttpClient, HttpUrlConnection. one more thing, agter submitting it will redirect me to another page. i don't need to do anything with this redirected page.
N.B: if this question is not appropriate with what i really ask previously, then you can suggest me, and i will post a new question. thank you
Nothing of this will work because he is trying to include HtmlUnit into a android project. HtmlUnit is not compatible with android because is refernces some java.* & javax.* classes which are not available in android.
Hope there will come a version for android.
sorry, i have lost all my hope on HTMLUNIT. :( to gain my goal i have used HttpUrlConnection & Jsoup ... that works for me. here is my procedure i have post my code in answer.
Here are the steps to follow:
Download the latest version of HtmlUnit from http://sourceforge.net/projects/htmlunit/files/htmlunit/2.11/
Unzip downloaded file
Go to lib folder --> Right click on htmlunit-core-js-2.11.jar and select 'copy'
Go to Package Explorer in Eclicse --> Chose your project --> Right click on libs folder and select 'paste'
Right click on the newly added file and click on 'Add as a library...' and select your project.
Repeat steps 3, 4 and 5 for the htmlunit-2.11.jar file
Add this two imports to your project:
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
Clean the project.
Please also check this link http://www.aviyehuda.com/blog/2011/05/16/htmlunit-a-quick-introduction/ for the htmlUnit quick introduction
I know it's too late to answer, but hopefully my answer will help other newbie's like me who is trying to webscrape in their android app and stumbled upon this thread for a working solution of htmlUnit in android studio. I used a previous version of htmlUnit (2.14) and it worked for me. Why I was trying htmlUnit, and not Jsoup ? because my target webpage had javascript calls, which was not giving a fully loaded html. So, in short: Use a previous version of htmlUnit.

how to setup details about an android app?

i have used eclipse, android sdk and phonegap to create a small application. I give it a test and create a test.apk package.
What i ma wondering is where can i set up some details about this app, like who made it, the app name, the version, an icon maybe, any other things i might need to setup.
I have a AndroidManifest.xml file and when i open it i get a nice gui but i don't know what to modify there
Im not sure what i need to set up and even if i need to.
A good tutorial is much appreciated. Thanks
You can set most of those things in the manifest file. If you want to include this information in your code, add license headers in all your classes, use java-doc etc.
If you want this information to be accessible in your app like from 'About' button, you have to handle it yourself.
Take a look at this example.
This details are to be filled when you upload it to android market. I dont think you set them in AndroidManifest.xml ! you can see the xml code , by clicking on the "source code" tab just below the UI .
Here's a tutorial that describes managing AndroidManifest.xml, the app name and icons from our AppLaud Eclipse plugin for PhoneGap Android.

Combine 2 android apps

Experts,
I am having the source code of 2 android apps which have been separately developed. I need to combine both of them as a single application so the output would be a single apk file. Let me more specific.
App 1: Shop list app -
App 2 Calculator app.
using a button click in the App 1 I would want to call the second app Calculator. I have researched on Internet and I am seeing some suggestions like library project etc.
Anyone who has some idea on the feasiblity, please throw some ideas on the same.
Thanks,
Harry
output would be a single apk file.
Then use as a library project.
Check this may help you
Setting up a Library Project
Referencing a library project
Open Eclipse-> right click on your project-> Build Path -> Configure Build Path
Go to "Projects" tabs on Top and add new project which will install two apks of the curernt project and the depends project that you just added.
It will do the trick for you.
Thanks

Facebook SDK not included with Android App in Eclipse?

I'm trying to add the facebook SDK to my project but it won't work at all.
I've followed the official steps; opened the fb sdk, made sure it's set to "is library", in m yown project go to properties->android->add library and it lets me select com_facebook_android and it shows up with a green tick next to it. HOWEVER, when i go back to that screen straight away it now has a red cross next to it, and if i try to launch the app in the emulator it has " com_facebook_android] Could not find com_facebook_android.apk!"
(This is just me testing without referencing the library in my app)
if i DO reference the library, then any calls to the facebook library give an error within eclipse and the tooltip suggests to add it to build path, so if i click that it launches fine, but still does the above apk error and the app force closes on any activity which references facebook.
As far as I can tell I'm following the official instructions fine but it just keeps coming back to that red cross in my app's properties
Does anyone know what this could be?
Not sure why you have the issue, i've setup a empty project with facebook library in it, if you have no luck then try downloading that, unzipping it and importing exsiting project into workspace.
link : Download here
you know what i have done one trick to use the official facebook SDK in my application, i have created com.facebook.android and add all the library classes into it. Then i can easily reach to access any class whenever i want it. This can be a way to use the classes inside your application instead of using Library.
Its running fine in my case.

Categories

Resources