OpenGLRenderer: Davey - android

I have noticed that from time to time, android shows the following log message:
I/OpenGLRenderer( 4958): Davey! duration=1923ms; Flags=1, IntendedVsync=12247...
Does anyone know the reason why my OpenGLRenderer is calling Davey!?

This "Davey!" is here because Dave Burke, VP on Android, cares deeply about jank and performance and filed many, many, many bugs for the engineering teams. This is just a fun nod to him when the system automatically detects jank.

I had the same question. It looks like a name, but the code suggests it isn't (?).
From Android source file frameworks/base/libs/hwui/JankTracker.cpp, around line 177
....
// Log daveys since they are weird and we don't know what they are (b/70339576)
if (totalDuration >= 700_ms) {
static int sDaveyCount = 0;
std::stringstream ss;
ss << "Davey! duration=" << ns2ms(totalDuration) << "ms; ";
....
The logging code was added here: Android 0e89ca2088b7e5424b35d9a564b83847dc0df84a.
Maybe ask the engineer that added the code: John Reck .

"Davey" is a transliteration of the Russian "Дава́й"
It means "come on!" and is an expression used to mean anything from "GO!" (in the sense of 'watch out!') to "COME ON!!!" (in the sense of 'hurry up! go!')
The programmer adding this was probably not Russian but making some kind of Slavic language joke.

Related

Reading Texts Kotlin - Android SDK 29

I'm relatively new to Android Dev and I'm running Android Studio on SDK 29 for a project to read through messages, find Roster text messages for where I work and then import them into the Google Calander via API. I've had a small amount of experience with Android before so the text and onClick etc are fine (Although I used java in the past, trying kotlin as it's the future). However I'm trying to play around with reading the body of all messages and just printing them to the screen so I can understand how it works, tweak things here and there and see the results I get. However just getting the body of messages and printing them is turning out to be quite difficult.
I had issues initially however they were to do with permissions not working correctly. From there I fixed that issue and got some working code with no errors however instead of getting an output of the body of the messages I got a random '12'. So after further researching and googling I've managed to get myself to what I think is a close lot of code however, it's just incomplete and I'm unable to see what errors there may be as I haven't found a working lot of code online yet.
Furthermore the android dev documentation hasn't been a huge help. So I'm reaching out. Sorry if this seems a easy fix however it's new to me and I havent' found anything online after a fair bit of searching.
Thanks in advance
This is my code so far:
var cr = contentResolver.query(
Uri.parse("content://sms/inbox"),
null,
null,
null,
null
)
if(cr.moveToFirst()){
do {
var msgData = ""
for(messages in cr.getColumnIndex("body")) {
lastSyncMessage.text =
lastSyncMessage.text.toString() + " " + msgData.toString()
}
}while(cr.moveToNext())
}
}```
Try the next code, the for loop is not correct:
if(cr!= null && cr.moveToFirst()){
do {
lastSyncMessage.text =cr.getString(cr.getColumnIndex("body"))
}while(cr.moveToNext())
}
This code will set the last sms body message as the lastSyncMessage text. Just play with this.

error with pymtp to work on python 3

I want to access a android device from python to download some photos.
libmtp works from the CLI.
Than pymtp. It's been around for a while but it's designed for python 2 and i'm using python 3. Meanwhile fixed several minor issues but i'm stuck at an error from function get_filelisting
specially this section:
ret = []
next = files
while next:
ret.append(next.contents)
if (next(next.contents) is None):
break
next = next(next.contents)
The error is related to the "next".
That section looks strange to me, i've been coding in python for a while but i'm new to ctypes. Tried a lot of variants, they all failed. The "next" could be confusing with python buildin function so i renamed it to nextpointer and came to this code:
ret = []
nextpointer = files
while nextpointer:
ret.append(nextpointer.contents)
nextpointer = nextpointer.contents.next
It seems to work but did it work by accident ? does it have any design flaws ? Could anyone with experience on python ctypes confirm this a solution ? Any suggestion welcome.
From python2.7 documentation
next(iterator[, default])
Retrieve the next item from the iterator by calling its next() method. If default is given, it is returned if the iterator is
exhausted, otherwise StopIteration is raised.
from python3 documentation
next(iterator[, default])
Retrieve the next item from the iterator by calling its __next__() method. If default is given, it is returned if the iterator is
exhausted, otherwise StopIteration is raised.
Notice that next() method was removed from python3 but the function still exists.
This is all I can say about the next function and .next()/__next__() methods.
I downloaded the pymtp module and get_filelisting() is slightly different from what you posted in your ported code, here it is:
ret = []
next = files
while next:
ret.append(next.contents)
if (next.contents.next == None):
break
next = next.contents.next
If none of this helped you (which probably didn't :D), the version of pymtp library that I am using is 0.0.6 download using pip.

Apportable & CoreMotion

I'm trying to get my game working on Android. I've ported it with the free version of Apportable and it works quite well, but I haven't been able to implement the gyroscope feature.
CMMotionManager gets initialized but the motion updates never start (or at least handleDeviceMotion: never gets called). The motion manager's isAccelerometerActive property is always NO, but isAccelerometerAvailable is YES.
Using [NSOperationQueue mainQueue] doesn't help either.
This is how I initialize the motion manager:
self.motionManager = [[CMMotionManager alloc] init];
self.motionManager.gyroUpdateInterval = .2;
[self.motionManager startDeviceMotionUpdatesToQueue:[[NSOperationQueue alloc] init]
withHandler:^(CMDeviceMotion *motion, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self handleDeviceMotion:motion];
});
}];
It produces the following message to logcat:
E/Sensors ( 507): HAL:ERR open file /sys/bus/iio/devices/iio:device0/dmp_event_int_on to write with error 2
E/Sensors ( 507): HAL:ERR can't disable DMP event interrupt
I have no idea what this means...
I'm testing the app on Asus Nexus 7.
Is there something special I need to do to use CoreMotion with Apportable?
Edit:
Here's a simple test project I created to demonstrate the issue.
CoreMotion should work with apportable. Here is a simplified initialization and usage paradigm that I've tested on a Nexus 7 (2012).
self.motionManager = [[CMMotionManager alloc] init];
[self.motionManager startDeviceMotionUpdates];
self.motionTimer = [NSTimer scheduledTimerWithTimeInterval:0.2
target:self
selector:#selector(handleDeviceMotion)
userInfo:nil
repeats:YES];
Instead of using startDeviceMotionUpdatesToQueue: withHandler: to process the motion events, try explicitly accessing the deviceMotion property in a handleDeviceMotion method which will be called by the repeating timer.
-(void) handleDeviceMotion {
CMDeviceMotion *motion = [self.motionManager deviceMotion];
// use motion data accordingly
}
And don't forget to stop updates when you're done!
[self.motionManager stopDeviceMotionUpdates];
For this sort of device motion in particular, we had a fairly layered series of issues that I've (hopefully) resolved with the next SDK update. I've implemented yaw, pitch, and roll, and they seem to give relatively sane values. If you're still having issues, email sdk(#)apportable.com (delete the parens obviously) and mention me.

Livecode Interactive Ads Android

I'm working off Livecode v5.5.4 on the Android platform... I've been able to successfully publish apps, however, can not figure out how to install inneractive ads... As LC has partnered with inneractive they provide direction which suggests its as easy as...
mobileAdRegister "YOUR-AD-KEY" //I've replaced with my APP ID from inneractive
local tDetails
put "30" into tDetails["refresh"] // The advert refresh interval in seconds
put 25 into tDetails["age"] // The age of the target audience
put "male" into tDetails["gender"] // The expected gender of the target audience
mobileAdCreate "myAd1", "banner", (0,0), tDetails
however, nothing seems to work... any LC ppl out there with advice??... thanks
If there's no error reported from Mark's suggestion you might want to ensure it's visible with:
mobileAddSetVisible "myAd1",true
Failing that could you post the result of the mobileAds function and let us know if the adLoaded or adLoadFailed message is being sent to the object that executed mobileAdCreate?
You need to check the value of the result:
mobileAdCreate "myAd1","banner",(0,0),tDetails
put the result into rslt
if rslt is not empty then
beep
answer error rslt
end if
Kind regards,
Mark

C & Android kernel module: what happened with f_flags here?

I have a self-coded kernel module in Android which I open with O_RDONLY|O_NONBLOCK.
O_NONBLOCK is 2048 in both the user-program and the kernel module.
I checked that with
print..("O_NONBLOCK is %d", O_NONBLOCK)
in user- & kernel-space.
But now, when I try to check if O_NONBLOCK was set, I got a really strange problem:
static int my_open(struct inode *inode, struct file *filp) {
if (filp->f_flags & O_NONBLOCK) {
printk("O_NONBLOCK");
} else {
printk("NOT O_NONBLOCK");
printk("O_NONBLOCK in my_open is: %d", O_NONBLOCK); // -> prints 2048
printk("filp->f_flags in my_open is: %d", filp->f_flags); // -> prints 1, not 2048 or larger
}
..
}
I tried something else:
cat my_device
but again, filp->f_flags is 1.
I would assume maybe 0 for O_RDONLY but not 1 which means O_WRONLY.
Anyone an idea or explanation?
EDIT:
I also don't expect cat beeing O_NONBLOCK, but O_WRONLY is totally wrong.
I open it this way:
pcm->dfd=open(fname, O_RDONLY|O_NONBLOCK);
and there's no fcntl later (and that shouldn't affect my_open at all.
But of course I also tried to "re-set" O_NONBLOCK with fcntl without luck.
You need to make sure that the userspace, indeed, passes what you think it must be passing. I find it hard to believe, for example, that "cat" would pass "NONBLOCK". It has no reason to.
Use strace on the userspace end to test what actually gets passed in.
Also, and a bit offtopic, are you sure you care whether O_NONBLOCK is set during open? Please remember that it may also be set using fcntl later on.
Shachar

Categories

Resources