I am creating a android application for eCommerce website.
Here at server side, i am using Shopify's eCommerce software.
So how could i call web service generated through Shopify's eCommerce software.
I have make research on it..
I found one link also link, but that demo is not running.
I need one simple demo where how can i use shopify api in android application
That Demo is working, I checked it today only. You can make a webview and use the Java/Android Library to make the call.
Use this part to make your call (for more details check demo code or api page):
JsonDirectoryCredentialsStore store = new JsonDirectoryCredentialsStore(getFilesDir());
Credential emptyCredential = makeEmptyCredential(shopname);
store.saveCredential(emptyCredential);
APIAuthorization auth = new APIAuthorization(emptyCredential);
URI authRequest = auth.generateAuthRequest();
Pass this authRequest to a webview and set a webviewclient to handle redirections by shopify.
You can then set up a callback to your localhost in the dev store you created and connect to that with the emulator loopback interface 10.0.2.2 from the app to test. At least that's the most convenient way I found.
Related
I'm trying to invoke one AWS Lambda function from my Android application.
If I understand correctly, I have to start with something like this:
BasicAWSCredentials creds = new BasicAWSCredentials(keyId, secret);
AWSLambdaClientBuilder builder = AWSLambdaClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(creds))
.withRegion(regionName);
AWSLambda lambdaClient = builder.build();
and then the rest of the code with InvokeRequest etc.
Problem is in the above code, after it app crashes. I can't find the correct set of libs to make this work in Android.
If I use
implementation 'com.amazonaws:aws-java-sdk-lambda:1.11.782'
then it compiles fine and executes up to the "builder.build()" and then crashes and if I use
implementation 'com.amazonaws:aws-android-sdk-lambda:2.16.12'
(which is supposed to be used for Android???) Then "import com.amazonaws.services.lambda.AWSLambdaClientBuilder;" is red cause there's no such thing in the lib..
I get that AWSLambdaClient is deprecated and AWSLambda should be used, then what about AWSLambdaClientBuilder? What should I use?
Basically, if everything above is wrong, how do I get to call AWS Lambda function (by the way, this is without using API Gateway) from an Android app? What libs (with versions) would work for it?
I tried to follow https://docs.aws.amazon.com/lambda/latest/dg/with-android-example.html tutorial, but they also have deprecated stuff, plus it wants to involve Cognito and I was under the impression that I could call a function directly with a key and secret of a user with specific policy..
A different approach, but you can use the API gateway or application load balancer and call the configured endpoint from the android application.
Benefit with this, you will not need to configure the application to have the client id, and client secret set up, and even if restart, it would be simple api gateway call.
Lambda can work with both API Gateway as well as Application Load Balancer, and it is pretty easy to configure. Refer this page for details on ALB with Lambda.
I'm currently implementing a part of Xamarin app, which needs to open links in browser, after clicking the URL. I need to add support for http, https, ftp and ftps.
Our app uses .NET Standard 1.6 (Thus, can't use WebClient Class or FtpWebRequest class).
Device.OpenUri(uri) works fine with http and https in both iOS and Android. But only works with iOS for ftp links. With Android, app crashes with ftp links.
For file links with ftp, I managed to download files using FluentFTP (version="23.1.0").
Now I need to add support for ftp links with directory structures, to open that directory structure in the browser. (Like the default behavior of the Chrome browser)
I have tried:
Device.OpenUri(uri),
By creating an intent (Not working for ftp)
What you should be doing is something like below:
Create an interface for your Dependency Service for Android.
public interface IWebFTPClient<T>
{
Task<T> MakeFtpRequestAsync(); //Add Parameters if needed
}
Then call the depedency service method :
DependencyService.Get<IWebFTPClient<YourType>>().MakeFtpRequestAsync();
Note: Above code is an example piece and may need changes as per your needs
Since FtpWebRequest is available in native android, use it something like follows:
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverUri);
Good luck
Revert if you have queries
I created Android App that is made by cocos2d-x.
I'd like to implement cooperation function with social network service (facebook and twitter )
For example, Like! button which separate news feed.tweet function.
But This function turned out to be a can of worms which I couldn't finish.
I found EziSocial. but I can't find any hints.
would you give me a
description of how to use and method of attach to existing app
We have series of tutorials available on our website. http://ezibyte.com/tutorials/
Disclaimer: I am the creator of EziSocial Plugin
I created my first Sencha touch 2 app by watching this video (http://youtu.be/5F7Gx0-W-M4) and it has a store page structured like this:
Ext.define('FirstApp.store.Places',{
extend:'Ext.data.Store',
config:{
autoLoad:true,
model:'FirstApp.model.Place',
proxy:{
type:'ajax',
url:'https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyCFWZSKDslql5GZR0OJlVcgoQJP1UKgZ5U',
reader:{
type:'json',
rootProperty:'results'
}
}
}
})
The after-build (after running "sencha app build native") package work very well on my MAC (all browsers) but the generated app (i am running it on my nexus phone) works but doesn't collect any data from the google maps json.
Any help would be appreciated
The example you are referring is using google map's place search API. You can not use this API when you build the app for mobile phone with proxy set to ajax . Basically, you can not use any resource that is outside your domain. Like if your site is at yourdomain.com and there is someotherdomain.com, then you can't make ajax request to this someotherdomain.com from yourdomain.com unless that domain allows you to. In this case, your mobile app is not having any domain. You are just loading a page inside webview.
The reason is, ajax will not be able to load cross-origin resources. App build works on browsers because I believe you're using chrome with --disable-web-security flag. To work with CORS you need to use JsonP proxy. It's the only way if you're packaging for mobile app. If in a case, you own the server ( not in this context though ) then you can allow CORS by setting appropriate headers like
Access-Control-Allow-Origin: *
or
Access-Control-Allow-Origin: http://yourdomain.com/resource
Try setting proxy to JsonP .
I am tring to invoke WebScript in Alfresco remotely using the URL http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home and the url will promth me with the authentication window allowing me to entire the username and password. This invocation works completely fine in the Browser..
Followed the steps described in the alfresco : http://wiki.alfresco.com/wiki/Web_Scripts
But when im tring to do the same in android app using webview im facing Authentication Error (HTTP Status 401-Error) and its not promthing me with the authentication window.
If you want to integrate it with an application you can better use the Login Webscript.
So in your app, just make a configure view, which stores the user + pass (encrypted). And then before you do the request login and then with the ticket Authentication call your webscript.
It will then look like this: http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home?alf_ticket=<TICKET>
Sometimes that doesn't work, then use http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home?ticket=<TICKET> instead.
Good luck!