KMM Library to interact with Google Analytics - kotlin

I'm planing to create a KMM Library to deal with Google analytics. So we create a single source of truth to add the tags we want to track in either IOS and Android mobile apps.
When a KMM is crated for dealing with libraries like Google Analytics, do we need to add in the library both versions IOS and Android Google Analytics ?
if so, I'd appreciate an example about how to deal with two libraries one in IOS and other in Android to execute it.
just need to confirm this,
thanks.

I gave a talk about doing this, and specifically talk about analytics in it.
https://www.droidcon.com/2022/06/28/sdk-design-and-publishing-for-kotlin-multiplatform-mobile/
The website has the wrong title, BTW.
Analytics generally is just a key and a map of values. The simple way to do this is to create an analytics interface in common code, and pass in an implementation on app start from Swift (and also on Android). That way, you don't need to figure out cinterop or anything complex with dependencies and versions.

Related

How do I access NFC capabilities using Flutter or React Native?

I'm trying to decide which language to learn so I can program an mobile app that revolves around NFC and your location. I heard Flutter and Reactive Native are two relatively new languages that allows you to write code for both iOS and Android and there's courses for them on Udemy. However when I Google searched "NFC Flutter" there wasn't any relevant articles on how to incorporate NFC. Is it worth learning either of the two languages or should I write my app separately in Swift and Java?
You can use either React Native or Flutter and still have NFC capabilities.
For Flutter there is this plugin you could try (haven't tested it myself)
For React Native you could use this plugin which is tested and works great
At the time of writing this answer there is no full solution for NFC in flutter.
That said, you can implement NFC functionality using PlatformChannels. Or, better, encapsulate in in a plugin.
That way, you can write a code for your app in dart for both platforms, but NFC functionality will call Native Swift or Java code to handle platform specifics.
Here is one plugin that is still Work in progress, that does the exact same thing for Android only. You could, for example, fork the plugin and add iOS code and there you would have full solution.

Cross Platform for Mobile Apps

i'm going into a real big project for building cross platform mobile application.
and i want to know what IDE should i use or what platform. and i would prefer if i could use a platform using html,css and js cause i have some experience in them. but if the platform doesn't support them it's okay if it's a VERY GOOD one
Main Features of the App:
it will have a chat feature(Messaging).
-Notification Center (Notifications for friend requests,updating statuses..etc)
Viewing categories for a certain place with its members and activities in this place.
Look into using PhoneGap. all you will need to know is Html, CSS and JQuery for a start.
All this techonology requires for you to do is write one set of code which you will be able to convert to multiple platforms (iOs, Android, Windows etc), no need to write independent codes for each.

xamarin get location at cross-platform

i want to get location (use gps) at xamarin.form - that is, in cross platform.
but i can't find. only platform-dependent (at android, at ios, etc.)
if you know, please share to me !
(i found xamarin.mobile - geolocation, but it is also platform-dependent T^T)
This is going to be device specific. Probably the best approach is to create an Interface in your portable class library and then implement the interface in your Android and iOS -specific projects. The PCL will connect to the implementation through the Xamarin Forms DependencyService. Please have a look at the following link Accessing Native Features via the DependencyService
It is likely that you will be able to use the other examples on the Xamarin site to write your platform-specific code. For example here is a link to the Android LocationService
Checkout Forms Labs. It should be pretty simple to reuse it even without Xamarin.Forms (if that's the case).

Evernote API in Unity3D

Since I haven't got any response on the Unity3d or Evernote forums, I'll try it here.
The last year I have worked a lot with Unity3D, mostly because the good integration with the Vuforia Augmented Reality library and the fact that publishing for multiple platforms is a piece of cake.
Now I want to show notes in an AR setting and am looking at the Evernote API for this. I couldn't find anything about using this with Unity, I can see why this is not the most common combination.
My question is: do you think I can access the Evernote API through Unity? If so, how should I do this? Or is it for this purpose perhaps wiser to make (parts of) the application with Eclipse/xCode?
Hope to hear from you!
Link to Evernote API: http://dev.evernote.com/doc/
The Evernote API has a C# SDK which you should be able to call through Unity. In terms of how to do it, you will probably need to download the SDK and follow the instructions yourself. Their github seems like a good starting point.
One thing to note is that Unity's .Net library for mobile clients are quite limited and with webplayer you will need to deal with sandbox security issues. But start with the standalone build first and see how you go

What are Leaflet and Mapbox, and what are their differences?

What are Leaflet and Mapbox, and what are the differences or usages of both? What are the main differences in their APIs?
The other answer is good but a bit outdated, since Mapbox has changed significantly in two years.
Leaflet is a JavaScript API for making maps interactive on the internet. It can integrate with Mapbox, but also plenty of other tile sources, like OpenStreetMap, and other data sources, like GeoJSON overlays.
Mapbox is a company that provides map services and technology - one of those services, Map tiles, can be used in Leaflet as base maps - same as you'd use Google Map tiles in the Google Maps API. Mapbox also develops a Leaflet plugin called Mapbox.js that makes it simple to integrate with their tiles while still using all of the great functionality in Leaflet. We also support Leaflet's development, since the maintainer works here.
You can use Mapbox.js without using Mapbox tiles, and use Leaflet with Mapbox tiles - they're entirely mix-and-matchable. Mapbox.js's additions, like TileJSON and UTFGrid support, make it easier to integrate with Mapbox maps, but don't change the existing behavior of Leaflet.
Update (2014-08-22):
My answer is slightly outdated. Please refer to #tmcw's answer for an up-to-date comparison between Leaflet and MapBox.
Original Answer (2012-09-05):
You're comparing apples and oranges.
Leaflet is "just" a map API. It doesn't provide data/maps itself. Mapbox is a service to design and publish maps, where the end-result is a bunch of generated map-tiles stored in the cloud (and some json files).
Thus, for example, you may consume Mapbox maps from Leaflet. Example
Anyway, Mapbox is developed by a company called DevelopmentSeed, and they have a map API which is indeed a Leaflet competitor, called Modest Maps, although much simpler and with less functionality.
So, to sum it up:
Leaflet -> map API , no data
MapBox -> design and publish maps
You can think of
Mapbox as the GitHub of the maps
OpenStreetMaps as git
Leaftlet as a git client
and mapbox.js as the 'GitHub for Mac'
Let me try to explain more:
OpenStreetMaps (OSM) is an open source project to create/display maps & geo-data; just like git allow to create commit trees for source control. They both are software that handle data.
Mapbox is a hosting company for OSM-based maps with some more power rather than just hosting; which is the same case of GitHub for git projects.
Leaftlet is a library to enable users to display/use OSM based maps on their browsers using OSM hosting service; just like any git client is doing with git hosting services.
mapbox.js is an enhanced library to display/use maps hosted at mapbox.com, which is already based on OSM; just like the "GitHub for Mac" client is made by GitHub to provide an interface to the projects hosted on their servers.
Hopefully this clarifies your doubts.
It is an old post, here is my update.
Mapbox now is using leaflet as their official JavaScript API (I don't know what's the internal working, but... I can't visit Modest Maps at all, and Mapbox doesn't mention anything about Modest Map on their current website).
Leaflet is better I suppose. It gives you flexibility to choose your map source and edit the features as you'd like to! It's just a bit time-consuming to learn though! And the top reason: it's free!