Using NavigationManager functionality without integrating Cars App library (androidx.car.app) - android-automotive

I'm developing a navigation app without the use of templates which are provided by integrating the Android for Cars App Library (https://developer.android.com/jetpack/androidx/releases/car-app).
I want to provide navigation/trip information to the host/system that will be used in the vehicle's cluster and heads-up displays. Using the Cars App Libraries NavigationManager API (https://developer.android.com/reference/androidx/car/app/navigation/NavigationManager) you are able to this. But to get reference to NavigationManager you need access to carContext, but in this case you would need to implement template functionality (that is what I don't want).
Is there a way to provide navigation information to the system/host without using NavigationManager (maybe using this API - https://developer.android.com/reference/android/car/Car) or is there a way of including Cars App Library using NavigationManager features but without implementing the template part?

Related

Tools for documenting and mapping APIs with application's user interface for impact analysis

I work on developing API services that internally call multiple micro-services
I was looking for a tool that could help me map public facing APIs with the application's user interface (application is available as native android/ios and PWA)
We do use tools like Swagger and NewRelic for internally maintaining API related details and documentation. However, I was trying to look up any tool(preferably open-source) that could help me map the api calls with the user interface
For example:
A Homepage Screen for the app with multiple buttons. Each button makes a REST API call. These REST APIs internally call micro services.
I would like to have a UI based tool where I could show the Homepage screen for the app(a screenshot) and then write APIs endpoints and routes associated to each button.
The reason I am looking to do this is because I believe this will make new people on the team(and external stakeholders) easier to read and refer to the application flow and how it is tied to the REST APIs. This will also make impact analysis easier when making changes to certain services/APIs

Rest API and admin in the same application

I'm new to building APIs, I made the first one using an MVC framework: codeigniter, with chris kacerguis rest implementation.
I'm not really sure this was the best think to do because I believe maybe the framework is not that "slim" or light just to API's purposes.
I plan to do a mobile App, an admin and a website so the three can consume the Api's services.
Is it a bad idea to have the API, the website and the admin on the same project? which are the pros and cons? or the best architectural approach?
Otherwise I will have: One Codeigniter project for the API and Another Codeigniter project for website and admin
thanks
You can create folders in "controllers" folder to organize your project and use the same project/env configuration :
controllers/Home.php
controllers/api/MyApi.php
controllers/admin/Admin.php
Edit : You will share models and libraries too.
In my project I realized 2 types of controller - REST and API. Admin js gui work with REST, other world work with API. You can do it simply with silex framework, a little brother of symfony.
The purpose of building a REST API so that you only have to build one project for your business model. This allows you to construct any number of applications on any platform, only requiring you to consume the API in different ways. This essentially separates/decouples the user interface from the business logic, and vice versa.
You should create separate projects for the REST API and each UI project should also be separated projects. This allows you to change the underlying code, language and platform in any one of the projects without breaking any of the other projects as long as the API signatures remain the same.
For example, you could have a live version of your website built using Codeignitor while developing another septate project using AngularJS. When your AngularJS project is complete you would simply swap out the project on your server (or create an entirely new website or server) still allowing you to use the other if required. Additionally, you may decide that you would like to move the API onto a different platform, language or database, develope it and swap the implementation when finished causing no changes to any of your UI projects assuming you have not changed the API signatures.

What is the best way to provide interaction between iframe pages?

Considering the next situation:
There are two GWT apps, and one includes another via iframe. So the issue is to expose some api functions of these apps so they can communicates with each other. For instance, child iframe GWT app can make calls api functions of its parent GWT app and vice versa.
What is the best way to implement it?

Limiting Access to "Functional Modules" in ASP.NET MVC

I am building a site in ASP.NET 4 and MVC2 that will have premium features, such as SMS notifications that will only be available to paid subscribers. I also have additional modules for things like Inventory, and Transactions etc
I am already leveraging the standard MembershipProvider, and am leaning towards using Roles tp provide this functionality.
ie: have an "SMSModule" role that the user gets if they pay for the add-on SMS service
This makes the controllers simple with a little attribute decoration, but the problem I see with this is that there will be a bunch of conditional code scattered through my views etc
Is there a better method of providing a "module" style approach in .NET 4 and MVC2???
You can add your conditional logic to view models, use the controllers to set the viewmodels appropriately and it should be fine... Sometimes you have to have the if statements inside the views even if not so ellegent. Unless of course you are using a view engine like spark then your if statements are placed in another unobtrusive location, but they still exist! You can always create HtmlHelpers and set the code to the serverside and based on the logic display appropriately...
FWIW I ended up using a combination of Descriptors in Spark View Engine, along with a custom Feature provider and associated ActionFilter

GWT pattern for handling mobile browsers

I am working on a GWT app that needs to serve a different layout to mobile device users. I can easily determine if a user is using a mobile browser; however, I'm not sure about the best pattern for handling them.
I am currently using the MVP pattern - would it be best to simply pass a browser-specific view to the Presenter or is there a more appropriate method?
You could set up GWT to detect the web browser used, as described in this question. Then, via Deferred Binding, let the compiler "slip" the correct view into place for the, say, mobilesafari user agent. That way, you won't have to litter your Java code with browser detection, etc.
The way I've done it is to have different GWT modules (with their own entrypoint, Gin modules, even different CssResources) and then on the myapp.html page you just have to check out what browser is requesting the content and based on it (javascript checks) the appropriate module
<script src="myapp/myapp.nocache.js"/>
or
<script src="mymobileapp/mymobileapp.nocache.js"/>
is loaded.
If you are working with GIN and an MVP framework (gwt-platform is my platform of choice) you can then reuse the code that was already written for the presenters and only implement different views.