Use generated java sdk for web portal? - iot

I am creating a web portal that controls the devices (like switching it on/off), visualize the data sent by those devices(endpoints). I have generated a java sdk. Do i use that sdk in my web portal or is it just for a device that sends telemetry data?

It is desirable to use generated sdk only for device that sends telemetry data.
There is no point in attaching sdk to your web application, as far as this part of the system doesn't treated as endpoint. It is bad practice to include endpoint sdk into the places, where lion's share of functionality would be ignored.

Related

Azure Mobile Services versus Custom API

We currently have a MVC5 web application that has recently gone live. Much of the business logic is contained within GET and POST controller methods in C# files. A native iOS app is planned for the project and the concern was expressed that we must ensure that the business logic is the same for the web app and the mobile app. I'm asking for anyone with experienced with Azure Mobile Services to elaborate on how we can easily ensure consistency between the web app and the mobile in terms of backend business logic. I see two options as of right now: 1. Create an API project and ensure both the web app and the mobile app call the same endpoints 2. Integrate Azure Mobile Services and ensure that the business logic matches the web app at all times. I'm just looking for guidance.
Thanks
If you are starting work now, I would start work with Azure Mobile Apps rather than Azure Mobile Services. Azure Mobile Apps can provide a web app and a mobile-friendly API for you.
Azure Mobile Apps provides three distinct things on top of Azure Web Apps. The first is a mobile-friendly data-sync capability. This is a RESTful interface that provides access to data from a backend resource. You can use it directly as a REST endpoint - great for your websites, but it is also an OData source. There are clients available for iOS (Objective-C/Swift), Xamarin (C#/.NET) and more coming that use this to provide a sync capability. The addition of a SQLite store provides an offline sync capability that your mobile app can utilize for performance and network efficiency.
The second is authentication that works with the mobile data-sync capability. This can be used across your web and mobile apps and links into enterprise authentication systems (via Azure AD), Facebook, Twitter, Google+ and Microsoft Account. One of the more interesting things you can do is provide personalized results - a user can only access their own records via data-sync. Mobile authentication is different and the SDKs provided in addition will provide that functionality for you.
Finally, there is a pass-through for Notification Hubs - a powerful push notifications system that provides access to APNS (for iOS devices), GCM (for Android devices) and WNS (for Windows-based devices) as well as push capabilities to Chrome and Safari web apps, Baidu and Kindle.
Nothing stops you from doing all this from a standard MVC5 ApiController, but the wrapping of the client-side SDK plus the additional functionality of the table controller reduces the complexity of the code you have to write.

Developing Mobile Native iOS applications to intergrate with SAP middleware

I am currently involved in defining strategy for a large future project, where it is proposed to developed native mobile phone applications that would integrate with SAP middleware.
I would like to understand how one would develop a native iOS mobile app that would communicate with SAP NetWeaver, using Odata?
Regards.
You can create server side OData service and communicate with it from mobile app by http/https protocol.
OData supports both JSON and XML formats.
If your application is rather simple - common BSP application can be used. It works faster but a little bit harder to develop complex application.
Odata is an open standard, there are libraries that you could use in your ios project hence you could consume the Odata service in your app. It is just another HTTP/HTTPS request-response.
SAP gateway expose Odata service
Consume that in the app using open source libraries available.
Another option:
Use SAP mobile platform 3 (a product from SAP to mobilise enterprise) to develop native and hybrid apps. It supports all major mobile platforms like iOS, windows and android.
It has an SDK which provides all enterprise level features to your app - offline support, SSO, different authentication mechanisms like LDAP and 509 certificate etc.
SAP also provides cloud based solution as well it is called Hana cloud platform mobile services.

AWS Mobile without the SDK

Is it possible to use the AWS mobile services (Cognito, Analytics, etc) without linking all the SDK in an Xcode project?
Background:
* While I am not new to AWS nor mobile programming, the following case is challenging:
We are shipping a mobile "framework" (not app) that uses our AWS for some parts (Authentication, logs).
And, as the AWS SDK has to be linked in the app project itself, this will require us asking all the clients (developers) to download and link it in their own projects.
What is used in the framework is just one request for authentication and one for logging (success/failure, disconnection), so no need for all the SDK.
I wonder if there is a possibility to request AWS services without linking against the SDK?
I know it's possible to put then under an umbrella SDK, or do some cherry picking from their git repository, but both of these seem like overkill.
As the request itself is a simple URL with Get/Post, is there a possibility (or tutorial) on constructing the request manually via NSURLConnexion/NSURLSession, etc?
Thank you
Talking to the AWS APIs is actually not that hard. The main difficulty is signing your http requests, and that's not nearly as bad as it sounds. Which leaves xml parsing accounting for most of the unpleasantness.
I've done it in go. The most informative part is probably the signing tests.
Indeed, it is possible. You will have to code calls to AWS at the REST level. Everything you need is in the documentation of AWS.
For instance, if you needed to execute actions on EC2, here's what you'd have to code:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#structure-of-a-get-request
You can call the HTTP APIs directly. Since the AWS Mobile SDK for iOS and Android are open source, you can look at them directly. Find the AWS Mobile SDK for iOS Source on Github, and the AWS Mobile SDK for Android on Github. Since you mentioned you need authentication request on iOS I am guessing you're looking for the Cognito Identity in AWSCore source.

Google API OAuth 2.0 flow for devices and .NET API

I would like to work with Google's .NET API while using OAuth 2.0 flow for devices.
I didn't find any way to use GoogleWebAuthorizationBroker or Create UserCredentials object in .NET when working with OAuth 2.0 flow for devices.
Is there a way to make the above requirement work? or should I use only REST API?
Thanks,
Ronen
Assuming you refer to this flow: https://developers.google.com/accounts/docs/OAuth2ForDevices, it is not supported in the Google APIs Client Library for .NET. So you need to build it yourself though you may be able to reuse large parts of Google's stuff.
Notice that the "OAuth 2.0 flow for devices" is not a standardized OAuth 2.0 flow, so support is not ubiquitous. Also, the Google says elsewhere:
If your app will run on devices that do not have access to a system
browser, or devices with limited input capabilities (for example, if
your app will run on game consoles, video cameras, or printers), then
see Using OAuth 2.0 for Devices.
If that's really your use case you should pursue my suggestions, otherwise you should switch to https://developers.google.com/accounts/docs/OAuth2InstalledApp (see the flow chart on the right side there as well).
The .NET client library for Google APIs supports OAuth 2.0 and it supports several devices including Windows Phone 8.1 and Windows Store applications.
The OAuth 2.0 documentation (including snippets) is available at: https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth.
My obvious recommendation is to use the library, because it will refresh tokens for you automatically (using the stored refresh token) and it's a light OO library which will do a lot of "magics" for you (such as media upload).
By the way, our samples repository includes full sample for a universal app, take a look at Blogger.Sample for more details.

What is the most efficient way to create end-points for an Amazon SNS service?

I am using Amazon SNS Service for an iOS application that needs push notifications.
I have figured most of the things, except for the part where I have to register my device tokens.
This is where Amazon talks about it. It can be done manually or with the help of createPlatformEndpoint API which they obviously recommend for bulk uploads. My question is how we can directly register tokens from devices that will install the app later on. The documentation talks about a proxy server which I would want to avoid as of now. Isn't there a direct way of doing this, like where I can directly call a method and push the device token received in the application to my SNS Platform?
This, is a possible duplicate except that it is in reference to Android.
The AWS Mobile SDKs support accessing SNS directly from the mobile device. If you're interested in seeing code demonstrating this on iOS, we included some as a sample we prepared for re:Invent 2013 called Mobile Photo Share.
The important thing to note when accessing SNS directly from the mobile device is that you'll want to restrict the credentials delivered to the device to only those services and resources you'll need to access. You can accomplish this via web identity federation or a token vending machine with appropriately restricted policy.
If you want to learn more about the Mobile Photo Share app, we had two talks at re:Invent about the app and its architecture. The video and slides for those talks are available here:
Building Cloud-Backed Mobile Apps
Integrating Social Login Into Mobile Apps

Resources