How does an oauth2 Workflow function in AAOS - android

I'm developing my first AAOS (and even Android) app, so bear with me if there are any noob errors.
So my intention is to develop an app for a music streaming service that has a public API and uses oauth2 for authentication.
My first idea was to just use a WebView, but Google prohibited using WebViews for oauth2 some time ago. Rightfully so as I understand the reason correctly, as my app could interfere/spy on the login credentials.
So I'm trying to use a CustomTabsIntent. Unfortunately, this does not work. When calling customTabsIntent.launchUrl(this, Uri.parse(url)) the "link viewer" app is opened, which only displays the Link as a QR code. So, it looks like the default app to open a link is this "link viewer" (at least in the Volvo Emulator I use for testing)
Here's a link to the actual Activity https://github.com/jasonwurzel/Deezomatic/blob/master/automotive/src/main/java/com/auto/deezomatic/activities/DeezomaticMainActivity.kt
Please don't look at the state of the code/project, I wanted to get the most annoying hurdle out of the way before starting to really develop ;-)

Related

Is there any way to launch my application right away without 'Ok Google"?

I've searched about launching my app with voice. And what I got is using Ok Google. However, I don't want this feature but start my app right a way without calling Ok Google. Instead, Hey, XXX Then, launch my app.
Maybe I can accomplish this feature by getting a permission of using microphone and using service of my app. In this way, At least my app will launch, if the user once launched my app during the device is on. Maybe using startActivity()?
Is it possible or not? If it is yes, What do I need to do to achieve this result?
It is not possible to launch your app using your own customized name like Hey Jarvis , open XYZ app.
You can only use the following commands in your android mobiles to launch your app.
Hey Google, open Facebook
or
Ok Google, open Facebook
The prefix, Ok Google / Hey Google are proprietary to Google's Voice Assistant that comes handy in Android mobiles. So we cannot change them as our wish, may be we can expect the something like you asked in future. But not sure.
You can refer to the google thread related to this here
As mentioned in the comments, you need to design your own voice assistant to do so. Even if you are developing your own voice assistance, not sure you can run them on your mobiles.
Edited
Maybe I can accomplish this feature by getting a permission of using microphone and using service of my app. In this way, At least my app will launch, if the user once launched my app during the device is on. Maybe using startActivity()?
You can use in-app voice features when your app is in foreground. You can give a try to this Google Actions on Android apps. Though this feature is new and limited, you can gain some idea regarding this.

Android native app to open web app

I'm looking for the easiest solution to the following scenario:
I've developed a web app.
I need to send an sms with link+parameters for a unique user's registration.
BUT I want the link to direct to a native app installation that will install an app icon on home screen, and all this native app has to do is open the link to the web app.
By that I can avoid the Awkward solution of using bookmarks in android.
I know nothing about mobile app programming, so by easiest I mean: Either very basic tutorial, or a working native app that I can just change the URL and resubmit it as a new Native app.
or Any other easy suggestion

Can you take the Facebook login connection on iOS/Android App and automatically log a user in when they hit Facebook on a mobile browser? [duplicate]

It's my first posting on here (although I've been using this site for reference for quite some time).
I've been trying for several days now to find or dream up a way to use Facebook's "Single Sign On" from within a mobile web app (not a native iOS or Android app) to automatically sign a user into a web app if they are already logged into Facebook from the native Facebook app on their mobile device for example.
My limited knowledge is telling me that it can't be done since the mobile browser and the 'system' (iOS for example) are too separated (I can't, I don't think, have my mobile web app use or access the native Facebook app on a mobile device in any way).
I have found and read the iOS, Android AND Mobile documentation provided by Facebook (https://developers.facebook.com/docs/guides/mobile/) which all seems to make enough sense, but after days of trawling through everything else I could find on the subject there doesn't seem to be a way to use, for example, the Facebook app on an iPhone or Android device to automatically log a user in to my web app if he/she is already logged into Facebook.
I've read lots about doing this from within 3rd party native apps and also other people trying to achieve a similar thing from within Desktop apps but I'm trying and hoping to be able to achieve this from a web app running within a mobile web browser.
I'd be very grateful for any help, opinions or pointers in the right direction since I think this would be an excellent step forward in UI for mobile web apps to have (not just the native apps).
Many thanks in advance...
Probably a bit late to the party but in case anyone else is wondering yes it's possible with Cordova/Phonegap and the Facebook Connect Plugin: https://github.com/davejohnson/phonegap-plugin-facebook-connect/
Using the FB.getLoginStatus() method at startup allows to check if the user is already signed in with the native Facebook App and retrieve its profile. More details in the examples provided in the repo.
I have not yet implemented it myself, but seems possible according to:
http://developers.facebook.com/docs/mobile/web/build/#login

My Facebook App also works inside iOS/android apps?

Can a custom FB web app be used inside the iOS / android FB apps? Docs are not very clear on that. You can create Bookmarks for native apps, but I want to have a bookmark pointing to our custom FB web app canvas. The goal is to develop an app that's usable on all platforms.
I've been making some test and I could'n execute a non native app from facebook app or web page, and it's not easy to load facebook web page in PC mode from a mobile device.
The official Facebook documentation for iOS says:
When a user does a search in the Facebook app your app will be visible if it passes a usage threshold. The search results will display apps that have been configured for SSO support. When the user selects your app from the search results they will be directed to your app. If the user had previously authorized your app they will be authenticated when your app is launched.
I guess that for Android will be pretty like this. So if you develop a native app that only shows a WebView pointint to your web (pretty simple by the way in iOS and android) must work with no problems.
Usually Facebook APPs are on Flash, so I don't think that it will work on iOS (Please correct me if I'm wrong with the Flash issue).
On Android, it would be extremely easy, having in mind it works with Flash with 0 problems. You'd just have to implement a WebView on your layout and point to the url of your facebook app.
In general, you can really create applications that work on both systems, iOS and Android, playing with the webView's. However, you have to know that they will never work as if they were written on native code in terms of performance.
From what I've seen, if a developer already has an existing mobile version of their app which is also on Facebook, they are able to create a tab for it that will appear on Facebook for iOS and Facebook for Android. I don't think you can create a bookmark to the webapp version to be seen on a mobile phone. Users can of course bookmark your webapp on their browsers, though.

Best Approach to write a FaceBook application for Android

BackGround:
There are Facebook APIs(and SDKs) available to develop applications for other Mobile devices like iPhone, BlackBerry etc, but it seems there are no official ones for Android(?).
People have ported Java APIs to work on Android and have written FaceBook Client applications(FaceBook dev: Wiki Page). Apparently, there is also a light weight FaceBook SDK in alpha release for Android(a la FBRocket). But it is not avised to be used in Production.
Since these FaceBook functionalities have been exposed as REST based service, most of work would invove sending requests in desired format over Http. So, writing a FaceBook client app for Android certainly is doable.There are similar applications already in market e.g.: Bloo.
Questions:
When asked to write a FaceBook client application what approach should one undertake? Should we choose the SDK or invoke the services over Http?
If there is already a Web application that integrates with FaceBook, can we just browse to that Application from inside a WebView and be done with this?
Thanks!
I would use the Java APIs. You mention they were "ported" but were they? You develop Android apps in Java, you can often just include .jar files and use them in your Android app without any sort of "porting". REST access to FaceBook would also work fine too.
Are you talking about a custom application that you've built on top of FaceBook? If you already have a webapp that works fine in the Android browser then it would be fine to just have your users go to that site by giving them the URL. If the WebApp is only part of your application then you could pop open the browser with that page open, or you could load that page in a WebView as part of your larger application. However if this is all your application is doing, then it's not really an application, it's just a glorified browser bookmark and I would strongly recommend against releasing an app like that to the Android Market unless you like getting horrible ratings.

Categories

Resources