I am using the examples from https://developer.glympse.com/docs/core/client-sdk/downloads link.
I tried the GlympseSendDemo and GlympseCreateDemo using Android Studio(without any changes apart from editing the temporary developer API key that I created by creating an account online).
When I run both examples, I get a
"Failed to create"
message. What could be wrong with this?
EDIT 1
Debugging both the samples, the _glympse member is null when it hits the breakpoint i set at createGlympse() method of GlympseWrapper class.
EDIT 2
The GE.PLATFORM_STOPPED event from the Glympse SDK is getting fired that causes the _glympse variable to be set to null through the call GlympseWrapper.instance().clear();.
So my question is why is this event getting fired within a few seconds of the app starting up?
Try setting a breakpoint in GlympseWrapper.clear(). I suspect the platform is stopping after starting causing _glympse to be set to null. If that's happening, double check the api key is entered correctly.
_glympse = GlympseFactory.createGlympse(context, BASE_URL, API_KEY);
// Also try adding this line here to get some additional log information
_glympse.overrideLoggingLevels(CoreConstants.INFO, CoreConstants.INFO);
Related
I'm trying to add a BackdoorMethod to a Xamarin.Forms application to bypass the login (IDP - opened in chrome browser) step. I have the feeling that the method is not getting triggered, but not sure, and I don't know how could I make sure about it.
I've read the documentation here: https://learn.microsoft.com/en-us/appcenter/test-cloud/uitest/working-with-backdoors
Check this thread: https://forums.xamarin.com/discussion/85821/xamarin-uitest-backdoor-on-droid-with-splash-screen-how-do-i-access-my-mainactivity
Checked this example: https://github.com/brminnick/UITestSampleApp/tree/master/Src
In the MainActivity.cs file I've defined the BackdoorMethod:
[Preserve, Export(nameof(BypassLoginScreen))]
public string BypassLoginScreen()
{
// some additional code here. the code is working, when I called it
// directly from OnCreate it was executed without any error
return "called";
}
From the test case i'm trying to invoke it like:
public constructorMethod(Platform platform)
{
this.platform = platform;
app = AppInitializer.StartApp(platform);
var result = app.Invoke("BypassLoginScreen"); // result == "<VOID>"
}
I'm not getting any error message, the method simply not called, or not returns anything. (or i don't know what's happening there with it, because breakpoint also not working as the app started from the device)
This should be already working. I have similar code and it works for me.
you can add inside your function
Android.Util.Log.WriteLine(Android.Util.LogPriority.Info, "BypassLoginScreen", $"Some text as info");
And observe the result in Device Logs, Filter by BypassLoginScreen to see if there is any log created with the tag BypassLoginScreen
Using here.com proprietary code I'm trying to get the list of map packages so that I'll hopefuly know a country ID I'm interested in so I'm using the following code to load all map packages:
MapLoader mapLoader = MapLoader.getInstance();
mapLoader.addListener(mapLoaderListener);
boolean packagesgotten=mapLoader.getMapPackages();
Now the maploaderlistener is supposed to catch the event when this download is complete. So I put some code to output the packages in the onGetMapPackagesComplete method of the listener but it never gets called. No error, nothing. This code is in an AsyncTask as network requests require that.
I am using Android's MediaRouter / Presentation API (the support.v7 version).
Everything works fine so far. The only thing that doesn't is:
When I quit my activity (e.g.teardown & remove the callbacks), everything still works fine.
However, when starting this activity (the previous mediarouter-activity was forcefully finished, thus onPause/onDestroy was called FOR SURE => so those callbacks in there are gone too, as also shown in my debug messages) again at some later point in time, the callbacks get created and added and everything. Just, that there is no more onRouteAdded called, only onProviderChanged (With the default provider and thus useless).
It does always work like that (with wifi display [miracast], emulated secondary display, chromecast secondary display..). Are there any resolutions which are not in the examples?
Would you like to look at some code? Which special cases? (Can't post it all..)
I couldn't find anything so far, thanks for your help, in advance.
If you change the Google Cast sample app to support MediaRouter.Callback:
https://github.com/googlecast/CastPresentation-android
Then I'm getting the onRouteAdded called every time.
Using getSelectedRoute()instead of the RouteInfo (which is provided by the callbacks) did the job for me.
MediaRouter.RouteInfo selectedRoute = getHelper().getMediaRouter().getSelectedRoute();
if(provider != null && getCurrentRoute() != null && getCurrentRoute().equals(selectedRoute)){
Log.d(TAG, "only provider changes, dont do anything");
return false;
}
if (selectedRoute != null) {
setCurrentRoute(selectedRoute);
}
return updateContents();
this is definetly weird (as the rest of the code looks exactly as in the provided google android developer samples), but it works.
I know this problem was resolved over 1 year ago, but probably it isn't the perfect solution. Maybe it will be useful for somebody else.
I had similar problem with exactly the same symptoms (no more onRouteAdded called). In my situation it was caused by improperly implemented deactivation of MediaRouter: to deactivate it properly you should not only remove all of callbacks, but select default MediaRoute as well.
if (!mMediaRouter.getDefaultRoute().isSelected()) {
mMediaRouter.getDefaultRoute().select();
}
I'm trying to use logCat.
I have the following code that gets executed
Log.i("MyLog", "Test to see if it works");
But the Logcat on eclipse only shows
All messages (no filters)
Is there a setting or something in eclipse?
In the Logcat menu there is a Green plus above the All messages (no filters)
Either use "MyLog" at the Log Tag input-field to only see your log that is tagged with "MyLog",
or use your applications namespace (like com.example.your_app) at the by Application Name to show all logs of your application without the spam you got with all messages of Eclipse and the Emulator. (This does still include the dalvikvm that increases the heap size, Choreographer which warns you when you do too much work on the Main Thread, and similar app-related logs though.)
Add a filter (the green plus) with by Log Tag:MyLog and by Log Level:info.
You have to create a filter manually with that tag from the Log.i in the LogCat view. You can use the + icon next to the Saved filters label
since android 4.2 google put a appops function into the Settings app ,but after a few weeks ,they close the entrance of this function, and they only close the entrance,the function code is also can be found in frameworks/base/services/java/com/android/server/appopsservice.java 。
But in the source code , I found there are two functions for check whether the operation can get the permission. one is startOperation() and another is noteOperation(), through reading the remark , i know that : startOperation is for a long-term permission check,and must call finishOperation after the operation is done. but the noteOperation is for a short-term.though i knew this but i also can't tell which time i should use startOperation and which time i should chose noteOperation .
Did anyone read this soucecode, and plz give me some suggesstion.
thank you in advance.
well , after a few days late , I found the answer finally.
the difference between startop and noteop is :
startop is prepare for some opereation that will work for a long time ,like gps,like vibrator and so on , you can start monitor a permission use startop and end monitor that use finishop , remember , finishop must be called after you end the monitor.
noteop is just for the short term operation , for example : check whether the app has the permission to send sms or receiver sms.
Obviously ,above is the difference between this two methods.
last but not least : ****