Android Webview flask website hosted on heroku - android

I have used Website 2 Apk builder pro for conversion of my flask app hosted on heroku. It uses auth0 of google. It is working like a charm in web but when I am using app with webview the auth0 google page is opening without retrieving all the saved google user. It is again asking me to sign in. So is there any way to use in the same way like other app uses it. Like native app uses it. Please tell me how to do that.

Related

Developing both Rails Web App and Android App that shares only one Database

I'm a 3rd year BSIT student who wants to pursue a career of Web Development in the near future. We decided for our thesis to make a Web App about a certain topic using Ruby on Rails since it's the tool that we used during our WebDev class. I've had several experiences and accomplished projects using RoR thanks to the help of this site.
Our Adviser suddenly suggested us to make an Android version of the app for the customer's side to utilize it's portability. what we would like to happen is the Customers can input and retrieve data through that android app from a database, on the other hand, the admin can also do the same using a Desktop Web App utilizing also the the same database used by the customers.
Is there any other recommendations of lightweight development and database tools that can help us make the desired Web App beside Android Studio and Eclipse? Much better if it can support Rails or Ruby.
Note: Also, we're planning to include a GPS feature where you can locate certain shops using the said android app
What you are looking for is an API. You have a Rails app, now you have to expose API endpoints from your Rails App which your Android App can access and send requests to.
I don't know if you learned about APIs yet but in short, you set up new links that retrieve information from the parameters and respond using either JSON or XML. Your android app will for example have a login form:
Name = john
Password = anything
When they submit the form, you take the name and password and send it using an HTTP request from Android to your Rails App.
#stupid example but this is how the link would somehow look like
http://www.your-site.com/api/login?name=john&password=anything
Your rails app should be setup to receive request via an API controller:
class ApiController < ApplicationController
def login
#authenticate user
#respond with json
end
end
Your Android app receives a JSON response from Rails, usually a status code telling Android that the authentication was successful or failed and then you have access to your Web App using Android but nothing is secure and you will have to setup tokens for each request, etc because API's don't have sessions like a browser. But since you are talking about a school project and not a production app maybe you can ignore the security part.
Read this blog post on how to build an API:
https://labs.kollegorna.se/blog/2015/04/build-an-api-now/

Access CloudKit from Android?

Is it possible to use CloudKit Web Service from Android native app? How will that authentication popup window appear in a native app if I want to let user able to modify records?
Can I put a button to the native app, that will open up browser and the redirected content will appear there, and when authentication successfull, specify a callback where token which uniquely identifies users, I guess user record name can be received?
Apple engineer talks about login from web here on this session video: https://developer.apple.com/videos/wwdc/2015/?id=704
CloudKit Web Services is intended "to provide a web interface for users". If you use it to provide a native Android interface, you will probably get your iOS app rejected and lose your CloudKit access entirely.
But if you want to try it, Apple already has documentation for CloudKit Web Services which explains how to authenticate users.
From looking at the session video you mention, and also at the links and comments from Richard, I would say the answer is No to writing full native Android CloudKit apps. The reason is that Apple does not give you the option to enter the userID and password in your own dialog. The user can enter those only in a web window popped up by the apple code. So it seems at least that part of the app (authenticating the user) needs to be done using web code. I am not an Android programmer so perhaps it is possible to put together a hybrid app that addresses this issue.
Having said that, public database access does not require an iCloud account so you may be able to write an app that only uses access to the public part of your container using native Android code.
I am no expert but this is what I read on Apple website.
Use an API Token from a website or an embedded web view in a native app, or when you need to authenticate the user.
Maybe its like Netflix. Because Netflix iOS app looks just like netflix.com. To me it looks like netflix is using embedded web view. Maybe you can do the same with CloudKit.

Multiclient Google plus Oauth using Phonegap

We have a Phonegap app (Android and iOS) and web app with web API that need to use Google plus authorization. We can't figure out how to implement that. So far we only accomplished to obtain access token from mobile app and send it to server, but that's not how it's supposed to be done for several reasons.
What we are trying to accomplish is to obtain authorization code from mobile app, send it to web component and get access token and refresh token there, which is the right way, and that's how it's done using native iOS and Android SDK, but for some reason it either can't be done using Phonegap, or we just can't figure it out. For web app it woks normally. If someone has experience with this that would be very useful.
The important thing is that user can log in from different devices and that API can recognise him and use refresh token to authorize.
It would also be nice if we could use the same app id for all clients.

Ruby on Rails REST API with Android Client that works offline

I am developing a web app on Ruby on Rails and an Android app. They have the same database structure, and now I want to sync the information between both apps. For this I am building a REST API on the rails app.
In the rails app I have devise for authenticating, but for the api I was trying to use doorkeeper which is a oauth2 provider, the problem is that I want to download all the users from the rails app to android app, and I want to give them the possibility to login in an offline mode, they can generate data in the offline mode, and after that, when they get online they will have to sync all the information with the web app. They also can generate data on the web app, so it has to be for both sides, to download information from the web app and to upload information to the web app. How can I achieve this? I have been reading a lot but I haven't found anything similar. I would really appreciate some help.
Sounds like you want to use a SyncAdapter (http://developer.android.com/training/sync-adapters/creating-sync-adapter.html). It supports background downloading/uploading and you can use that for your syncing process.

Android App for Rails App storing Sessions/Cookie

I am new to both Android and Rails. I built a simple Rails app to log in to post comments and leave replies to others' comments as well. I am trying to see how to build a native Android app to respond to this Rails app and have come across a question with sessions/cookie.
In order for me to build a native android app that can allow a user to log in and browse through the rails app, do I have to write a code that receives cookie from the rails app and store it in android sqlite database? Thanks
Are you trying to load a view in HTML (an embedded browser), or render a view on the device using the native controls? If you're doing the former, surely Android already handles all this for you, just like a WebView in an iPhone app does?
If you're doing the latter, you should build an API that uses something like OAuth for authentication, rather than maintaining a session cookie. This approach means that you store a pair of (revokable) OAuth credentials on the device and that you don't need to work with the user's username/password.
I'm not sure on what your end goal is here.

Categories

Resources