I have a question about the android WebViewClient, is it possible to make for instance a page where users can login and then save the credentials into a cookie like we could do on regular website that is not running inside an Android App?
If we can't do this, what can we use to achieve this, it should be a really basic easy thing to create we don't need tight security or anything. We basically only want to use an email address to let the user login to the application and let them stayed logged in.
Any suggestion or help would be greatly appreciated, sins Android Studio is completely new to me.
Thanks in advance.
so basically, WebView is just used to display, and doesn't actually have the ability to save data. However, you can use CookieManager & CookieSyncManager to store the data you need
Related
I have trouble with my project.
I want make a Login Session with Navigation Drawer (Like Play Store) with mysql.
I want to put username and email to "navigation_header", but always failed.
I use SharePreference with volley to manage this session Login.
When i put this session to other activity, Login success. I put session to TextView, and logout to Button with LinearLayout.
Can you help me to my trouble, or are there website to help this trouble?
for doing your issue you have to write independent api that must written with server side language like php, asp or etc.
then you have to wirte session management system with shared preferences and then write your logic in your app
in this case you may have two problem
in all android networking codes you must write your codes in asynctask. if you are using volley you dont need this.
2.your layout have problem
for doing twice above you have to see log and you must be a cool debuger
if you have problem yet , copy your error in log here to exactly help you.
I'm new android developer, I don't have any great idea.
I wanna make app that will take some input from users then will pass those input to a website for sign up & then
when press Sign Up button from my app button will hit the website Sign Up button.
But I don't know how to do that.
I was search on web long time, but maximum was use JavaScript, I don't have idea about that.
Can anyone please clear me this things please.
Thanks in Advance
Its not at possible to have 2 views as in one screen. Its possible if you create some API on your website to which you Send the data to server and in return it will give you true or false, to track data insertion succeded or not.
You can't do that if the website don't provide the api service.
Is it possible ? Load any website in background (like Gmail/FB) and get inflated my App's widgets (like Username,Password) and when user gets Log-in , again my app get inflated.
In short, i want to make an App will be used as "Sandwich" between end-user and website. To achieve more user friendly environment and way to access the website. Because App will be used among non techno-savy peoples, So i want to present i their own way. Please help.
You can use a WebView and enable caching on it.
webView.getSettings().setAppCacheMaxSize(1024*1024*8);
webView.getSettings().setAppCachePath(Context.getCacheDir());
webView.getSettings().setAppCacheEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
i am fairly new at developing with Android but am trying to learn to learn new things:
I wanted to build a simple app that would take data from a website and then show it on the app. I considered using WebView but WebView seems to just put a browser within the app.
I understand that an app such as this would have to 1) Communicate a login and password and pass it to the website and then 2) show the data in the app
What i wanted to do was integrate the data into the app. Another question is if there are any implications regarding this type of app because a user would have to log in using a Username and Password.
So how could I go about this(i just need some general pointers, what to use, etc.)
Thank You!
You can use an HTTPClient to execute a POST function to return the html data from a webpage. You would only have to provide login credentials if the page you're trying to access is username/password protected. A simple tutorial on this can be found here
http://argillander.wordpress.com/2011/11/23/get-web-page-source-code-in-android/
I have an Android and an iPhone mobile app into which I need to put a Facebook like button for marketing purposes.
The problem is that I am not sure what is really being liked when a user likes something from inside a mobile app. I have a website for the two apps (Android and iPhone) so it seems that this website should be liked when a user likes something from a mobile app.
Is that possible to do?
From my experience and what i know, Facebook doesn't leave you the possibility to use a likeButton into a mobil Application, they don't want the users to be spammed by those in every apps.
From my point of view, there is two solutions, but neither are perfect :
You use Facebook OpenGraph and create a like action for a Website Object, you can find more informations about Facebook OpenGraph on facebook documentation, OpenGraph web tutorial and the last one examples that are more specific to iOS. But if i remember right, you won't be able to create an action called "Like", i think facebook will prevent it so there is no confusion for the users, but as i'm not sure at all, it's still worth a try.
the second solution is to make a simple UIButton, and when you click on it you just show a webview of the facebook page you want the user to like. If you want to know if the user liked your page, you can always make a request for his likes and try to find your facebook page id in it, whenever the user did exit the webview.
I hope i answered your question.
And if ever you find a way to make a real facebook like (not an opengraph), directly in a native mobile application, i would be very interested in knowing the howto.
EDIT:
Actually, only the second solution would work if it's to like a facebook fanpage, as for OpenGraph you need to be able to modify the metadata sent by the page so it fits the properties of your object.
The Opengraph solution would work only to make a fake "like" on a webpage of your own.
Use this code. You should be logged in to Facebook, before using this code. Check whether the Facebook session is valid and then use this code.
WebView foll_fb = (WebView) findViewById(R.id.btn_foll_fb);
String url = "http://www.facebook.com/plugins/like.php?layout=standard&show_faces=true&width=80&height=50&action=like&colorscheme=light&href=YOUR_URL_TO_LIKE";
foll_fb.loadUrl(url);
foll_fb.getSettings().setJavaScriptEnabled(true);
foll_fb.requestFocus(View.FOCUS_DOWN);
foll_fb.setWebViewClient(new LikeWebviewClient());
Correct. If you click a like button inside a mobile app, most users expect that they have liked the corresponding page. If you have a page for both the android and the iOS app, then it should like the corresponding one.
In case you wanted to know how to do this, I can give you the main idea. Simply place a button, that on tap, runs whatever is necessary to like something. Since I personally haven't done that, I'm not sure what needs to be run.
Hope that helps, but someone else probably has a better answer than I do. Meaning the actual code to that.