How to add Google analytics to android app widget? - android-widget

I've been struggle to had Google analytics to my app widget, without any success, The code works fine when using from Activity but not from the app widget.

Hi use this code inside your AppWidgetProvider onEnabled() method
Tracker t = ((MyApplication) context.getApplicationContext()).getTracker(
MyApplication.TrackerName.APP_TRACKER);
// Set screen name.
t.setScreenName(screenName);
// Send a screen view.
t.send(new HitBuilders.AppViewBuilder().build());

Related

How can I receive return data from a HTML popup on Flutter Web

I am working on a plugin that launches a WebView to carry out some auth verification. Using the webview_flutter plugin, it works fine on Android and iOS once I call the runJavascriptReturningResult function. It returns the document.getElementById('return').innerText and then I parse the result. But on Flutter web, the webview_flutter_web does not currently support runJavascriptReturningResult, so it throws a platform error once invoked.
I tried using an HTML Popup, but I don't know how to extract the return data before the popup closes.
My implementation for the popup is like this:
html.WindowBase _popup = html.window.open(url, name,'left=100,top=100,width=800,height=600');
if (_popup.closed!) {
throw("Popups blocked");
}
How do I get the return data before the popup closes? Is there another way to do this on Flutter Web?
Maybe listening beforeunload event on the new window and getting the return value before it closes.
The solution was to listen to onMessage. Then get the event data from it.
html.window.open(url!, 'new tab');
html.window.onMessage.listen((event) async {
log(event.data.toString()); // Prints out the Message
});

Can we add image path (of local database) to the android APP widget (Home Screen Widget)?

Context: I am creating a flutter app wherein the screenshot of a particular app-page needs to be shown in app widget.
On Android side, we are using Kotlin (which I have no idea of, I don't even know if this thing is possible).
Path provided by flutter will be like:
/data/user/0/com.example.myboardapp/app_flutter/20220613_151934.jpg

Driving Navigation using google maps in flutter

I am using google maps in my flutter app, I have done drawn paths from one point to another using flutter_polyline_points, Now I want to get turn by turn navigation as mentioned in this attached picture, is this possible in flutter, or how I will achieve this
This is Google Map Turn by Turn Navigation View. You can launch it using Android Intent Plus lib
AndroidIntent mapIntent = AndroidIntent(
action:'action_view',
package: 'com.google.android.apps.maps',
data: 'google.navigation:q=$yourDestinationLat,$yourDestinationLng'
);
mapIntent.launch();
Read more at this link

RE:Create a button which when pressed it replaces an existing object on the screen to another object in Smartface App Studio?

After seeing #catherinelagoon's post I also having difficulty in quite understand how to replace an object using a button so is it possible to create a button which when pressed it replaces an existing object on the screen to another object in Smartface App Studio?
I tried using the answer provided in the post however I couldn't understand it much due to I'm a beginner in using Smartface App Studio and coding itself.
Thankyou and sorry for any inconvienience
After you create an image you should add it to a Page so it can show on that page. So here is a simple code for creating and showing an image on the page.
var image = new SMF.UI.Image({
visible: false
});
Pages.Page1.add(image);
function Page1_TextButton1_OnPressed(e) {
image.visible = true;
}

Callback for Google Play Ads (android.googleAdUnitId or ios.googleAdUnitId build hints)

My CodenameOne app works perfectly when using the android.googleAdUnitId or ios.googleAdUnitId build hints in order to show the Admob Ads banner at the bottom. However, I would like to give some coins/diamonds as rewards when users click on the bottom Ads banner. How can I do this? Is it possible for the main class to handle this by implementing the AdsListener interface like the https://github.com/chen-fishbein/admobfullscreen-codenameone supports (or at least the main class should implement a special interface which has the onAdLeftApplication() function only?)
Shai, Chen, anyone, do you have any advice?
There is no way to adjust the banner behavior, if you want to reward the user use full screen ads, there are quite a few full screen ads providers with a CodenameOne integration see these:
https://github.com/chen-fishbein/flurry-codenameone , https://github.com/chen-fishbein/startapp-codenameone , https://github.com/amiga/aerserv-codenameone