Is there a way to monitor the cpu and power consumption of an individual app on a smartwatch (android wear)? - profiling

I was wondering if there is a way to monitor the cpu and power consumption of an individual app on a smartwatch (android wear) remotely such as through the Android studio or something little eye which is not accessible anymore ? The usual handheld apps such as power tutor and trepn doesn't fit the screen of the watch.
Any suggestions would be appreciated on somehow adapting these apps to work on watch or anything else ?
Regards

Try System Info app for Android wear. Download it from Google Play. Screenshot of their app shows a monitoring dashboard that fits the android watch's screen.

Yes! you can use the Battery Historian to get very detailed information about wake-locks, CPU usage, VM usage, CPU temperature.. the list goes on.
After putting your watch in Developer Mode, run :adb bugreport > battery_stats.txt and feed the battery_stats.txt file to the battery historian. It will output detailed information about all apps and the system in general, with the option of seeing stats for the app of your choice.

I finally used power tutor (battery consumption) and dumpsys cpuinfo for these measurements.
Power tutor does not provide correct power values when it comes to absolute values, however, it works for relative comparison of various apps (power consumption) which was the case with my situation.
http://ziyang.eecs.umich.edu/projects/powertutor/
https://developer.android.com/studio/command-line/dumpsys.html

Related

System clock on my Glass device is wrong?

So I'm developing an app for Glass which involves setting alarms for certain times and dates. However, when looking at the logcats on Android Studio, I can see that the time is wrong--WAY wrong. Like 2 weeks, 9 hours and some change off. It is my impression that the time shown in the logs is the system time of the device.
Indeed, when I start the glass device, the clock shows an incorrect time. Interestingly, when I go to the calendar app, that gives the correct date.
I can't figure out how to set the date and time anywhere in the settings of the device. Has anyone dealt with this?
I'm not certain, but I think the time is only ever synced from a paired phone, not from the internet.
So are you pairing the device to a phone or connecting directly to wi-fi?
In not paired to a phone, try that.

Flash game for desktop + mobile using starling/stage3d

It has been a nice run of about 7 or 8 years now that we have developed Flash browser based games for the web exclusively. Of course with the ubiquity of mobile devices, things have changed. Clients are starting to demand, almost assume, that games will work in the browser - on the desktop and on their tablets.
Putting aside the whole discussion of using an HTML5/JS solution instead, we're sticking with Flash for the next project and need to figure out the best way to get it to run on the desktop browser and on the iPad, while maximizing code re-use.
Given the current state of technologies today, what is the best path? This game will be a 2D side-scroller type game with some physics, and development will be done mainly with bitmap graphics (as opposed to vector) and spritesheets.
Here are what I understand to be my options:
Option 1: Develop the game targeting the 'standard' flash player for web (11 or higher), then port to an iOS AIR 3.2 app, doing appropriate optimizations like the ones outlined here.
Option 2: Use Starling/Stage3D for desktop, and then port to an iPad app. Just wondering if starling is ready for primetime making production quality games for mobile + desktop. Does Stage3D still work well enough in software mode on older machines?
Option 3: The new feature in CS6 that lets us publish to HTML5. Is this even close to mature enough to publish a full game? The benefit of this solution is that it could run in the browser on the iPad instead of being a separate app.
Thianks so much for any guidance.. I'm also wondering about pitfalls, and optimization techniques involved in any of these. But it seems the underlying question in all this is should we use Starling/Stage3D or not?
Definitely Option 2.
You could go with Option 1, but performance on mobile would likely suffer without Stage3D hardware rendering.
Option 3 is only a good choice if you're designing/porting ad banners with basic animation, should be avoided for game development.
More here: Adobe Gaming SDK

Is it possible to debug Android apps on Acer Liquid E from Windows 7?

I'd like to buy an Acer Liquid E as an Android test phone (normal size, high density screen, android v2.1 up to 2.2).
Before actually doing that, it'll be great to know if anyone had any bad experience with it. My dev environment is Eclipse + ADT on Windows 7 64 bits. I'm thinking about things like USB drivers, logcat displayed correctly, breakpoints hit, and so on.
I read about this issue, but it's from 2009 and in the end it was solved anyway.
Thanks.
This is not exactly the answer to this question, but I'll post it in case it might be useful for some other developer in need.
In the end I did not go into buying this exact phone model. Instead I bought an Acer Liquid MT S120 (or Metal) phone. In order to be able to debug apps on it, I just had to look for official Acer Windows drivers.
Those where relatively easy to find (here version 1.0): the only quirk was that I had to select the former Android version (2.2 instead of actual 2.3) in order to see the drivers under the Application tab, otherwise they would not show.
Apart from that, debugging experience was very straightforward: plug USB in, and Eclipse/adb where able to see the device. APK upload times are really fast (I guess this holds for any USB-connected device too). The same holds for integration/functional tests.

How to choose server for production release of my Django application?

My company is at the very end of development process of some (awesome:)) web application. This app will be available as a online service for (hopefully) some significant number of users. This is our biggest django release so far and as we are preparing to release some question about deployment have to be answered.
Q1: how to determine required server parameters for predicted X number of users/Y hits per minute or other factor?
Q2: what hosting solution (shared/vps/dedicated) is worth considering?
Q3: what optimizations can be done at a first place?
I know that this is very subjective and dependent of size of a site, code quality and other factors but I'm very interested in your experiences with django (and not only django) deployment. Any hints, links, advices are kindly welcome. Thanks in advance.
What hosting solution you want to have depends also on how much you want to take of your server yourself (from upgrades etc to backup...), and you should decide if you want to have the responsibility or leave it to someone else.
I think you can only really determine the necessary requirements and bottlenecks in your applications through testing with the estimated load! Try to simulate as many requests.... as you expect - think about caching (where memcached is the best option you have)! If you try to cache things one great tool is the django debug toolbar (http://github.com/robhudson/django-debug-toolbar) which can show you also much about how many database hits you have (dont take the times it shows for that for granted, but analyse them and keep an eye on the number of hits) and eg. how many templates are rendered....
If your system grows, you can first of all think about serving your static media files from another location! Coming to the web server I have made great experiences using lighttpd instead of the fat apache, but I guess you have to evaluate that for yourself!
Also take in consideration what database backend to use, in shared envionments there's in most cases a bigger load on the mysql than on the postgres servers, but also evaluate what works best for you!
You can get some guesses here, but to get a halfway reasonable performance estimate you have to measure the performance of your application yourself. You should then be able to roughly extrapolate the performance on different hardware.
Most of the time the bottleneck is the database, you should get enough RAM to keep it in memory if possible.
"Web application" can encompass so many different things, we can really do no more than guess here.
As for optimization, if it fits to your needs implement some caching (e.g. with memchached), that can give you huge speed improvements.

Restrict functionality to a certain computer

I have a program that is using a configuration file.
I would like to tie the configuration file to the PC, so copying the file on another PC with the same configuration won't work.
I know that Windows Activation Mecanism is monitoring hardware to detect changes and that it can tolerates some minor changes to the hardware.
Is there any library that can help me doing that?
My other option is to use WMI to get Hardware configuration and to program my own tolerance mecanism.
Thanks a lot,
Nicolas
Microsoft Software Licensing and Protection Services has functionality to bind a license to hardware. It might be worth looking into. Here's a blog posting that might be of interest to you as well.
If you wish to restrict the use of data to a particular PC you'll have to implement this yourself, or find a third-party solution that can do this. There are no general Windows API's that offer this functionality.
You'll need to define what you currently call a "machine."
If I replace the CPU, memory, and hard drive, is it still the same computer? Network adaptor, video card?
What defines a machine?
There are many, many licensing libraries out there to do this for you, but almost all are for pay (because, ostensibly, you'd only ever want to protect commercial software this way). Check out what RSA, Verisign, and even microsoft have to offer. The windows API does not expose this, ostensibly to prevent hacking.
Alternately, do it yourself. It's not hard to do, the difficult part is defining what you believe a machine to be.
If you decide to track 5 things (HD, Network card, Video card, motherboard, memory sticks) and you allow 3 changes before requiring a new license, then users can duplicate the hard drive, take out two of the above, put them in a new machine, replace them with new parts in the old machine and run your program on the two separate PCs.
So it does require some thought.
-Adam
If the machine has a network card you could always check its mac address. This is supposed to be unique and checking it as part of the program's startup routine should guarantee that it only works in one machine at a time... even if you remove the network card and put it another machine it will then only work in that machine. This will prevent network card upgrades though.
Maybe you could just keep something in the registry? Like the last modification timestamp for this file - if there's no entry in the registry or the timestamps do not match then fall back to defaults - would that work? (there's more then one way to skin a cat ;) )