I just started working on Google Tag Manager. I got it worked. But I faced one issue. That is, each time I edit or add some new macros, I need to create new version and publish it. Unless I am not downloading the new version and saving inside assets/tagmanager and also unless I refer with the new version name of the downloaded file, I am not able to see my updates.
Is it so? If so, I didn't understand why this is useful. Is anything done by me went wrong?
I got it worked.The issue was when we keep the json or binary inside assets folder, then on openContainer() call, Google Tag Manager will check for the saved file first. Then only it will goto the network and search. This caused issue to me. So I removed the file kept inside assets/tagmanager folder.
Also I called container.refresh() before we set value inside the singleton class.
Sample code:
ContainerOpener.openContainer(tagManager, CONTAINER_ID, OpenType.PREFER_NON_DEFAULT,
TIMEOUT_FOR_CONTAINER_OPEN_MILLISECONDS, new ContainerOpener.Notifier() {
#Override
public void containerAvailable(Container container) {
container.refresh();
// Save container for use by any other activities in the app.
WPContainerHolder.setContainer(container);
//perform your other functionalities
}
});
Related
I have been working with DJI Mobile SDK for Android, making my own application by following this tutorial: https://developer.dji.com/mobile-sdk/documentation/android-tutorials/MediaManagerDemo.html
But i have to download all pictures at once at the start of my gallery, and i coudn't manage how to do it.
Is there any example showing how to do it?
I think it should happen at MainActivity.java from the MediaManagerDemo tutorial. Should i create getFiles() and put it alongside getThumbnails and getPreviews (on line 317)?
scheduler.resume(new CommonCallbacks.CompletionCallback() {
#Override
public void onResult(DJIError error) {
if (error == null) {
getThumbnails();
getPreviews();
}
}
});
Should i create a Callback for this? What else should i look out?
Thank you all in advance!
EDIT: I stopped and thinked calmly about this, and managed to solve this by creating a downloadAllFiles() method after getPreviews(), where it checks if the connection was succeed and calls downloadFileByIndex for each one of the items. I also implemented a way to check if there is already a file with the exact size on internal storage, to avoid unnecessary downloads.
If anyone is interested, heres my code on Github
Have you looked at the section in the tutorial on Downloading and Editing the Media files?
I'm trying to integrate the google play Leaderboard with help of the play-games-plugin-for-unity plugin into my game.
It works fine, committing to Leaderboard an all, only one thing is not working. When I call the Leaderboard
//LEADERBOARD
if (GUI.Button(leaderboardButton, "Leaderboard"))
{
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(Constants.LEADERBOARDID);
// Social.ShowLeaderboardUI();
}
it opens the window where I see all leaderboards. But I'm giving a specific id. This would be the behaviour I expect from the line Social.ShowLeaderboardUI(); which is commented out. The overload with a given Id (hid behind Constants.LEADERBOARDID) should start the specific Leaderboard UI according to the doc. Someone knows if this is an issue (haven't seen any report on GitHub) and how to solve it? It isn't that that big of an issue, but one click is better than two.
I tried something interesting. I changed the Id to some wrong value. Still the same behavior (opening the window with all leaderboards). Of course committing the score doesn't work anymore.
Okay, i found the error in the sourcecode of the Plugin, fixed it and resolved the problem. So here I present the fix if someone needs it. It's in the LeaderboardManager class.
This is how ShowUI is called:
internal void ShowUI(string leaderboardId, Action callback) {
Misc.CheckNotNull(callback);
C.LeaderboardManager_ShowAllUI(mServices.AsHandle(), Callbacks.InternalShowUICallback,
Callbacks.ToIntPtr(callback));
}
This should be the correct version
internal void ShowUI(string leaderboardId, Action callback) {
Misc.CheckNotNull(callback);
C.LeaderboardManager_ShowUI(mServices.AsHandle(),leaderboardId, Callbacks.InternalShowUICallback,
Callbacks.ToIntPtr(callback));
}
}
See the difference? C.LeaderboardManager_ShowAllUI instead of C.LeaderboardManager_ShowUI is called.
Inside Google analytics admin section I created 4 custom dimension. 1st dimension scope is "user", 2nd, 3rd and 4th dimension's scope is "hit".
I set parameters inside my onCreate function and send them in onStart command of my Activity. But when I check custom reports, I see that 1st dimension is set correctly. But no data for other 3 dimensions. I tried different days and waited but no change. I can see 1st dimension's data successfully. How can I set these custom dimensions, what do I miss ?
#Override
public void onCreate(Bundle savedInstanceState) {
MyUtil.initializeGAtracker(mContext);
MyUtil.getGaTracker().set(Fields.customDimension(1), "aaa");
MyUtil.getGaTracker().set(Fields.customDimension(2), "bbb");
MyUtil.getGaTracker().set(Fields.customDimension(3), "ccc");
MyUtil.getGaTracker().set(Fields.customDimension(4), "ddd");
MyUtil.getGaTracker().set(Fields.SCREEN_NAME, "myscreen");
}
#Override
public void onStart() {
super.onStart();
MyUtil.getGaTracker().send(MapBuilder.createAppView().build());
}
I also tried this. But it didn't help:
MyUtil.getGaTracker().send(MapBuilder
.createAppView()
.set(Fields.customDimension(2), "bbb")
.set(Fields.customDimension(3), "ccc")
.set(Fields.customDimension(4), "ddd")
.build()
);
Is there a detailed resource for setting multiple custom dimensions ?
I only found this:
https://developers.google.com/analytics/devguides/collection/android/v3/customdimsmets
Edit: Documentation is not adequate, also custom dimensions documentation has syntax error.
The code that you provided should work correctly.
Can you provide more details on MyUtil class?
Do you see any errors in debug mode? The SDK should output a bunch of errors if there is something wrong.
The SDK also prints out the hits that it is sending over wire. Can you copy and paste one of such hits here?
Also, your code snippets do not show you setting the tracking id. Can you check that you have set the ID? You can set it in the xml config or in the SDK APIs.
I'm having trouble getting Eclipse to see that I've just put a new image into my project when referencing that image using R.drawable.this_text
So I drag my png into myProject/res/drawable-hdpi in Eclipse's Project Explorer. The name of the image is this_text and it's a png!
So I go into my application and I want to put this on the screen; So here's the code for that...
private void setTitle()
{
ImageView title = new ImageView(this); //this extends activity
title.setBackgroundResource(R.drawable.this_text);
...
}
This I have done before and each time I do it I experience the same thing:
if i just dragged my this_text.png into the Project Explorer in eclipse, the word "this_text" will be underlined in red, and not allow me to compile or proceed. I try to F5 (refresh) the project. I try refreshing the image foldr, the src, the actual java...etc! I try closing and opening eclipse but nothing really works. So I quit for afew minutes and work elsewhere in my application, and eventually this error goes away!
Well I'm impatient today-- And I'd rather know how to solve this incase I need to do any quick programming! So does anyone know what to do?
I'm using eclipse Version: Indigo Service Release 1.
Thanks- Ethan
R files for android are generated. Rather than refreshing you should be able to CLEAN the project which should fix your issue. You could even just delete the error from the problems list which would allow for compilation to start and for the generated R file to be created. Or you could make a change to an xml which would also allow for the file to be regened. As always make sure you are up to date on your tool chain.
I'm trying to use PhoneGap with Android. In the Sample that I run the main app opens an html file:
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
Now if I change something in the html page, Android always shows the previous content.
Is it possible that the output files (resources in that case) are not updated?
Also if I change the name of the html file in /assets/newName.html and into .loadUrl nothing changes.
Thank you, F.
I'm determined to find a proper answer to this, at the moment changes in the assets dir do not trigger a rebuild.
At the moment I'm slapping a new line in the Activity.java code to force a rebild/deploy..
Will update once I've looked for a real solution.
I see this sometimes when I add a data file to a project in eclipse.
If you think you pkg isnt being updated (re-built) then just rebuild it manually. If your using eclipse just do project->clean and select the project you want to clean. it'll rebuild automatically and include anything that was missed out.
OK Guys found.
The tutorial in the wiki.phonegap.com is obsolete.
Samples instead are updated!
Many thanks.