I have been trying to use FBConnect in my app but whenever I try to reference the SDK, it doesn't quite do it.
This is the screenshot
Please help. I am stuck for past 4 hours. Nothing found on google or here on SO
Refer to this page: http://www.mobisoftinfotech.com/blog/android/845/. Seems like you should add the JAR file. What you did here is add a library - an open project in Eclipse that serves as a library for another project.
Clarification: when you click add, you see "FacebookSDK". It shows as valid until you close the properties dialog. Then when you open the dialog again, it has a red X next to it.
If that is what is happening to you... I ran into the same thing a long time ago. The facebook sdk needs to be in the same parent folder as your project.
For example, if you are running out of c:\users\me\workspace\my cool project,
the facebook sdk needs to be in c:\users\me\workspace\facebook-android-skd-2.0.2.b
No idea why, but after beating my head against the wall over this for a couple of days I figured it out.
Related
I think this is probably a basic question, but I just could not find the button. I was trying to create a new Android project from the starting page. But when I click on New Project it gives me a page with the options of Java, Maven, Gradle, Groovy Griffin... instead of the familiar starting page with Blank App, Google Map, etc.
When I opened a previous project, it opens Tags like C:, Users, Android, etc. The image is below:
Any idea how do I find that page back?
You may need to update the SDK first, by SDK Manager.
Don't know what happened, but I closed Android Studio for one day. When I opened it the second day, it got back normal. (I also closed all project when closing the Studio.)
OK, I have been wanting to try the new ActionBarCompat, however, I am not able to run my programs in the emulator.
I have been trying to implement the following: http://antonioleiva.com/actionbarcompat-how-to-use.
and have been stuck on basically the first part. However, working with the author of that content, I was able to get further as I was not adding the project under sdk\extras\android\support\v7\appcompat folder like stated. However, I still think that might be the reason I cannot do this...
More detail can be found here: http://antonioleiva.com/actionbarcompat-how-to-use/#comment-43
Basically, on my first attempt, I just created an Android project, and changed the source code as indicated. Code would not run on the emulator. So I went back to the original code, and that ran on the emulator.
Checked online, found out I might need to add the \extras\android\support\v7\appcompat folder as a library to the project I am building. So I added that and a new android project was created. There were build errors from the start, but I failed at trying to add it as a library to my project, and deleted it....thinking this was way overboard.
After back and forth chats with author of linked website, I found out I had to do that overboard thing.
So I tried the following link to the T: (I cannot post more than 2 links due to low repuation...I will add this link as a comment below)
However, Eclipse would not allow me to add the appcompat Existing Android Project...but it did allow me to add the appcompat Existing (General) Project. I think this may be some of the problems??
Right now, I cannot run the project at all. Eclipse is showing a red exclamation mark on the project folder, but all the code seems to be fine. So I don't know what to do now...I recreated this project several times over, and this one was the one where I knew what to do...and I am still getting problems
So...
I decided to move to Android Studio...updated the IDE, updated the SDK manager to include the new support library, and other things. Created a new project, added to the build.gradle file as shown in the link provided below in the comment. I ran the ant build, and then built the project...tried to import the right things to allow ActionBarActivity, but I could not get that far.
I can import
"android.support.v7.*"
"android.support.vy.R" // and all folders within
but nothing allows me to add ActionBarActivity, and I don't know why.
FYI, I guess I would prefer a solution to Ecplise, as it seems like I actually got somewhere with it.
The best example to use is from here, and I would follow it closely. I had similiar issues when I first came across this. Problem was I misunderstood what I needed to do
http://developer.android.com/tools/support-library/setup.html#libs-with-res
I am having a problem with my SDK Manager. It doesn't pop up when I click the icon of the window.
I have downloaded the file for the 2nd time but it still doesn't pop up, I followed the instructions in here After Installing ADT Plugin, Welcome to Android Development Doesnt Appear as well i must have missed something but all is well I'm just missing google com.google.android.gms. And for that I cant continue with my project.
How can I fix this mess.
If you are missing com.google.android.gms.*, it means you need to import google-play-services_lib after opening it as project. Actually you should read the answer here and follow it. Hope this helps you solve the error. If not then please comment.
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.
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.