[Q] Android Layout / Activity Select via Hardware Detection? - General Questions and Answers

Hi all,
First post here - looking forward to participating and working hard towards competency in Android development!
In the short time that I've been at this, I've noticed a great emphasis put on the importance of building a layout that will work across a range of Android hardware, or at least work well with both phones and tablets.
From what I've seen so far, the way to deal with this challenge is to compromise, and to not use absolute sizing for views etc..
I'm wondering if there is any kind of API available that would make it possible to detect hardware (at least screen size?) upon start up, which would then allow for switching to the appropriate XML layout?
I've not encountered it in any of the tutorials I've seen so far....
If this API *doesn't* exist, I would guess that the fact that the apps run on a VM might make any kind of hardware detection problematic if not impossible....
I'd appreciate any enlightenment on this that I can get!
Thanks in advance!

russ6100 said:
Hi all,
First post here - looking forward to participating and working hard towards competency in Android development!
In the short time that I've been at this, I've noticed a great emphasis put on the importance of building a layout that will work across a range of Android hardware, or at least work well with both phones and tablets.
From what I've seen so far, the way to deal with this challenge is to compromise, and to not use absolute sizing for views etc..
I'm wondering if there is any kind of API available that would make it possible to detect hardware (at least screen size?) upon start up, which would then allow for switching to the appropriate XML layout?
I've not encountered it in any of the tutorials I've seen so far....
If this API *doesn't* exist, I would guess that the fact that the apps run on a VM might make any kind of hardware detection problematic if not impossible....
I'd appreciate any enlightenment on this that I can get!
Thanks in advance!
Click to expand...
Click to collapse
OK to bump?

Related

BlenderPocket & ROM related questions

Let me start by praising this forum. You're all members of an incredible community. I just purchased my first mobile device (besides Sega's Game Gear and the original Nintendo Game boy, if you'd be liberal enough to put these in the same category), the hTC Raphael (AT&T's Fuze more precisely), and you guy’s have got me really excited about this technology.
Excuse me for continuing off topic, some background information may help you to answer my questions.
I’m really into technology, I’m always learning more about web standards, xml, hardware engineering, open source development, and computer science in general. I have a small computer lab in my house comprised of desktop systems dating from 1994 -2005. Due to financial limitations I don’t usually buy new equipment. As a hobby I sell and repair computers, and I’m really into web development (SVG has been my main interest for a while). I’m a very novice programmer, taking my first baby steps into Java though I’ve briefly used C++ and I’m fairly fluent in Javascript.
Let’s get back to the Fuze already! Heh.
So I’d obviously like to customize the Fuze to my liking, and I’ve been doing my homework. I bought the device because of its support for SVG, VPN (for my home network),WIFI (the university I’m attending has a large WIFI network), and Opera Browser. I just tried out tyguy’s forum post, http://forum.xda-developers.com/showthread.php?p=3042587#post3042587 , yesterday. After some customization (rhedgehog's Raphael Tweaks, adding support for zooming with the scroll wheel in opera, screen rotation via accelerometer, My_Flash3_1) I realize that I’m pretty disappointed with the device. It seems to be running slower than ever (I used the default rom w/ the bloat ware for a week), my email had broken (probably because of Sprite Backup restoring ‘personal information’ w/out ‘system files’, luckily nightbird’s post, http://forum.xda-developers.com/showthread.php?t=412438 , linked me to the software that fixes this ‘can’t view my inbox’ issue), the TF3D Music Library changed for the worse, but I’m not here to complain. Tyguy’s post was adequately informative, and a great start for beginners like myself.
At this point you’re probably saying “What is your question, and what does this have to do with BlenderPocket?!”
So.. I understand that the graphic rendering support of the Fuze is less than what some would like (probably due to the Qualcomm Chipset). Pauloke’s Diamond VR Hologram v2.02 runs on my Fuze, but at a frame rate of 0.17FPS. I’ve read up on Hard-SPL by Raphael Elite Team, Raphael Elite Project’s RC2 ROM, Aruppenthal’s RRE ROM, and Monx’ ROMeOS2. I’m cautious to try flashing, but I have an insurance policy, so I’ve decided to try Raphael Elite Project’s RC2 ROM.
On to the questions!
Has anybody tried BlenderPocket on a Fuze? http://russose.free.fr/BlenderPocket/ This would be an ideal application for my device.
Do those of you ‘in the know’ think that the rendering support of the Raphael could handle this app? The system requirements for BlenderPocket are quite low.
Which ROM’s effectively enhance rendering support for OpenGL, MD3DM, SVG Graphics? / Is there a ROM you would recommend for my Raphael? (after reading my autobiography, lol ) I understand that these are complicated issues involving Qualcomm proprietary drivers, I'm just trying to catch the most up to date information on Raphael graphics development.
I understand that there are some issues with the Fuze keyboard. Blender, among other apps, require input configuration from hard keys.
Where might I find information about mapping keyboard keys to apps (specifically pertaining to the Raphael)?
Where might I find a table of the hard key codes (ie: PAD_00x01)? http://russose.free.fr/BlenderPocket/?q=node/22
Does the ‘HTC Fuze Keyboard Fix.cab’ fix the keyboard issues I’m speaking of (the issue some have noted about not being able to configure keyboard keys as input to emulators and the like), or just adjust for the AT&T keyboard layout?
While on the topic of emulators.
Has anybody successfully run FPSEce on their Raphael? Sonhy claims that it works great on his system, http://forum.xda-developers.com/showthread.php?p=2642151#post2642151 . Others complain of keyboard and rendering issues. It would be incredible to use this device for work and play, a PS1 emulator would be ideal for play time. :-D
Thanks in advance for any advice or answers to my questions. All advice is appreciated.
Also in advance I apologize for any duplicate questions, I’ve spent a week combing the forum and these are some questions that I’m left with.
I am more than willing to donate my time to testing and development as well as money (what little I have of the stuff) when I'm better educated on who's hands it belongs in.
EDIT: After installing the Dimond Ati Drivers I now have 16.67 Average FPS during execution of Pauloke’s Diamond VR Hologram.
Now if only I could figure out this button mapping. I'm trying out ButtonFinder.exe
[email protected] said:
Which ROM’s effectively enhance rendering support for OpenGL, MD3DM, SVG Graphics? / Is there a ROM you would recommend for my Raphael? (after reading my autobiography, lol ) I understand that these are complicated issues involving Qualcomm proprietary drivers, I'm just trying to catch the most up to date information on Raphael graphics development.
I understand that there are some issues with the Fuze keyboard. Blender, among other apps, require input configuration from hard keys.
Where might I find information about mapping keyboard keys to apps (specifically pertaining to the Raphael)?
Where might I find a table of the hard key codes (ie: PAD_00x01)? http://russose.free.fr/BlenderPocket/?q=node/22
Does the ‘HTC Fuze Keyboard Fix.cab’ fix the keyboard issues I’m speaking of (the issue some have noted about not being able to configure keyboard keys as input to emulators and the like), or just adjust for the AT&T keyboard layout?
While on the topic of emulators.
Has anybody successfully run FPSEce on their Raphael? Sonhy claims that it works great on his system, http://forum.xda-developers.com/showthread.php?p=2642151#post2642151 . Others complain of keyboard and rendering issues. It would be incredible to use this device for work and play, a PS1 emulator would be ideal for play time. :-D
Click to expand...
Click to collapse
The htc fuze keyboard fix only fixes the keyboard layout if you use a touch pro rom which has different keyboard layout. Most roms here are touch pro roms, so you will need this for correct layout. I noticed on that emulator thread there was a link to this keyboard mapping for games,http://forum.xda-developers.com/showpost.php?p=2703133&postcount=3
I've tried a few of the roms here, Da_G's is very good if you don't want to use the touchflo3d UI. With touchflo, the ROMeOS roms are hard to beat, although NATF and Proven roms worked well for me also. Choose one and flash, you'll be much happier with your fuze once you do as they are all huge improvements over stock rom.
Thanks Showaco. I had also seen Dilta's KforRaphael.CAB (Thanks Dilta!) Just hopeful that a more permanent fix to the issue could be developed. May be my first venture into programming for the Raphael.

GPS software with Speed Logging and Replay

I'm trying to find a gps app to run on my Raphael that is capable of recording/logging a trip including timestamps.
I want to be able to replay the trip precisely, preferably on the phone, but if absolutely necessary I'd be willing to replay it on a laptop computer (I have a macbook pro and am running windows vista in a virtual machine) and logically I can replay it from a website as well.
Specifically, I want to be able to replay this in a courtroom in front of a judge, but I don't need to make a grand show of it (thus the reason I prefer replaying from the phone rather than carrying in a laptop).
Any advice would be great. I've considered writing my own app for this, but I really need to be able to replay the trip with graphical maps visible, which makes it more difficult to do. I've got TomTom installed already (which doesn't have this feature built-in as far as I'm aware).
tracking
I have not found a software which does what you are expecting, so I have acquired a TRACKSTICK PRO which does all what you require including tracing the trip on google earth!!
Hope this help
Chris from snowy Chamonix (France)
A completely new device, especially one without it's own ability to navigate would just add to an already excessive bunch of cables and take up a valuable power plug.
I can't figure out where or how to purchase one. The "get it now" button just takes you to a form to submit for them to call you back...This and the fact that it claims to be a "low-cost" solution makes me think that they aren't very interested in dealing with single unit sales.
Thanks for the advice, it's just not what I had in mind.
TrackMe might be what you are looking for.
bubble said:
TrackMe might be what you are looking for.
Click to expand...
Click to collapse
This looks pretty good I think. At least it's great for tracking and exporting, at least a little easier to work with than GpsGate which appears to only do NMEA sentences and a few file formats that nothing else reads. But this still leaves me trying to find the best way to present it.
I'd still like to be able to do sort of a playback of the trip rather than just data points on a map...and I'm still holding out hope for demonstrating the trip from my phone, but I'm starting to realize that none of the major GPS nav apps seem to have this feature, or at least I haven't found proof that they do. I think iGo might have a record/playback feature, but i haven't been able to verify.

[Q] a simple question about android...

I have a simple question about Android in which I have not found the simple answer to... (Although I think I know, I just want some clarification). I recently switched over to Windows Phone 7 because of various reasons, I will not name them here as that is an entirely different subject, however one of the reasons i switched was because of overall responsiveness of the OS. Why does Android's touch response feel sooo clunky? Yeah transitions and app launches are nice and quick, but I mean like pinch-to-zoom, and scrolling... I have played with the latest and greatest both rooted (with and without custom rom) and non rooted (with or without OEM UI), Motorola Xoom, Atrix 4G whatever is being claimed latest and greatest. But no matter what they all have the same touch response lag no matter what. This, believe it or not, is a major deal breaker for me, and before the majority of you speak, I'll speak for you; "why is something so simple and small, barely even considered a nuisance, be such a nuisance?" for me, i love fluidity, so, it just is. At this question however i do retort; if its such a "simple" or "small" nuisance, why can't it "simply" be coded to feel as fluid as Windows Phone 7, or iOS?
Luisraul924 said:
I have a simple question about Android in which I have not found the simple answer to... (Although I think I know, I just want some clarification). I recently switched over to Windows Phone 7 because of various reasons, I will not name them here as that is an entirely different subject, however one of the reasons i switched was because of overall responsiveness of the OS. Why does Android's touch response feel sooo clunky? Yeah transitions and app launches are nice and quick, but I mean like pinch-to-zoom, and scrolling... I have played with the latest and greatest both rooted (with and without custom rom) and non rooted (with or without OEM UI), Motorola Xoom, Atrix 4G whatever is being claimed latest and greatest. But no matter what they all have the same touch response lag no matter what. This, believe it or not, is a major deal breaker for me, and before the majority of you speak, I'll speak for you; "why is something so simple and small, barely even considered a nuisance, be such a nuisance?" for me, i love fluidity, so, it just is. At this question however i do retort; if its such a "simple" or "small" nuisance, why can't it "simply" be coded to feel as fluid as Windows Phone 7, or iOS?
Click to expand...
Click to collapse
I will try to answer since I've been using android before. android now as I believe is still in development stage. especially because it started from open source, where many developers get involved to participate in android development. unlike windows or the IOS platform. development is only done by the company itself through microsoft and apple. Except for third-party application development
android is a system (for run smoothly) with very powerful hardware. so that the source code would require a very complicated of encoding. Its a very difficult job to sync between the needs of software with hardware which is available. and vice versa. in an application such as pinching and scrolling there is more than one command which contains a lot of code. and should be remembered that this is a system. which are all related to each other for the overall operations to run smoothly based on the minimum demand of the hardware required. if there is one character in which is wrong of encoding or difference may cause the application not running properly.
for high-end android device such as Xoom, atrik 4G I'm sure the hardware is not an issue. I'm sure it was more caused by the complexity of encoding in one of the applications listed that is running inside in the whole operating system, making it not running smoothly. because so many commands which must be running at the same time is what make pinching and scrolling activity to be "clunky" like you said. you can differentiate by turning off the internet connection or turn off unnecessary applications running in the background. But I'm sure very soon android operating system will have a system which is more stable and efficient in encoding such as those held by the windows or apple.
My answer may be added by other members of the more expert in these matters. as a newbie, i am just trying to help based on the knowledge I had acquired over the years. CMIIW
Yeah I figured it would be something like that, I owned a Droid (1st gen.) and I had multiple setups from completely stock to my favorite, Cyanogenmod (always on the latest stable build, although I've already flashed CM7 RC2 and its probably the fastest its ever been at 800 MHz) everything was perfect except; scrolling and pinch-to-zoom. The scrolling is almost there, it actually lags for a bit but if I leave my finger on the page, it locks on to that position and stays there, but once I lift it to continue scrolling down or up it'll lag a bit again. The pinch zooming is just horrible no matter what. Unfortunately, given the nature of open source, and coding software in general, there is no such thing as "finished" software, so since this is open source, and the software is basically written to run on "nearly" whatever device you choose to flash it on, i don't think that problem will ever be solved. However, if Android does eventually reach that richness of responsiveness, then i will more than gladly switch back.
issues of a system running smoothly is different from one device to another device.
due to the wide variety of different android devices that causes the emergence of issues on the system stability. it was time to google as the main developer sets the standards for the development of next android os. while there is no standardization of hardware is set by google. it will be very difficult for other developers to write code/adjust performance in the operating system command. all this time writing code is must be adapted to the device from vendor itself. This will bring up the differences result of writing the code on other devices from another vendors (competitors). so if we running bencmark test or head to head test on both devices from different vendor the result will not be the same.
and if there will be a standarization set by google i believed it will not againts a spirit of an open source
I think the hardware that the WinCE (well...the shoe still fits) and Android phones are made on is essentially the same, in terms of the CPU power, the actual CPUs, the memory and the various other systems (graphics, etc.). Maybe not identical but overlapping classes and performance.
I haven't played with the new WinPhones but have noticed that every Android phone, no matter how fast and how "bare" factory, sometimes goes out to lunch. Apparently that's just the way the OS is written, it sometimes goes off to do other things internally (loading code? checking hardware states?) and you can't do anything except wait for it to come back.
But then again, almost every OS does that at times, including the main Windows OSes. That's just how they are done these days. If you had a cell phone fifteen year ago, you could turn it on and dial NOW. With any of the new cell phones? Can you do a cold power up and have a functioning phone in less than 30 seconds? Uh, no. But they call that progress, because you rarely have to power them off these days.
Every OS has tradeoffs, if the WinPhone makes you happier, by all means do it.
Rred said:
I think the hardware that the WinCE (well...the shoe still fits) and Android phones are made on is essentially the same, in terms of the CPU power, the actual CPUs, the memory and the various other systems (graphics, etc.). Maybe not identical but overlapping classes and performance.
I haven't played with the new WinPhones but have noticed that every Android phone, no matter how fast and how "bare" factory, sometimes goes out to lunch. Apparently that's just the way the OS is written, it sometimes goes off to do other things internally (loading code? checking hardware states?) and you can't do anything except wait for it to come back.
But then again, almost every OS does that at times, including the main Windows OSes. That's just how they are done these days. If you had a cell phone fifteen year ago, you could turn it on and dial NOW. With any of the new cell phones? Can you do a cold power up and have a functioning phone in less than 30 seconds? Uh, no. But they call that progress, because you rarely have to power them off these days.
Every OS has tradeoffs, if the WinPhone makes you happier, by all means do it.
Click to expand...
Click to collapse
I agree with you, I do like both OS's for their own benefits, currently I do like WP7 better than Android and keeps me "happy". However if you notice; that's not my prime motive in starting this thread, I didn't come here to say one is better than the other. I just want to know why those two simple things (scrolling and pinch zooming) are not fluid on Android. You can't use the excuse that it's different hardware because Microsoft is playing that trick too. You can't use the "its busy doing other things" excuse either, while WP7 doesn't have multi-tasking, iOS does (somewhat) so it can go "do" something else but will still feel fluid. In a multi-OEM environment it is up to the OEM to optimize it for the device it runs on, which is why it baffles me that even Sense and MotoBlur and others make performance decline a bit and still has the lag. Shouldn't it be the opposite?
Nothing? So no one can tell me why Android's responsiveness (scrolling, pinch-zooming) sucks?
Luisraul924 said:
Nothing? So no one can tell me why Android's responsiveness (scrolling, pinch-zooming) sucks?
Click to expand...
Click to collapse
The answer is quite simple (and the above replies are miles off the mark). Hardware acceleration.
WP7 has it, Android doesn't.
FloatingFatMan said:
The answer is quite simple (and the above replies are miles off the mark). Hardware acceleration.
WP7 has it, Android doesn't.
Click to expand...
Click to collapse
So the hardware acceleration runs throughout the entire OS? I thought it was mainly just the XNA and Silverlight stuff that was accelerated (I do believe those are different than native OS code, as Microsoft isnt allowing developers to write apps with native code. Future compatibility issues I guess)
Of course it's the entire OS. Why do you think MS's minimum spec stipulations are so high? This is what Windows Mobile was so plagued with, and how MS fixed that problem.
Luis-
"So the hardware acceleration runs throughout the entire OS?"
It isn't so much that the hardware acceleration runs in the OS, but that the hardware itself has certain routines built into it, on the firmware level, so the OS can just call those routines instead of trying to calculate them.
To oversimplify a bit, for instance, a hardware accelerator for "zoom in" might be programmed into the video chip system to automatically tell it "take the 50 pixels around this spot and blow up up to 250 pixels, refresh screen" where the OS would be saying "OK, let's take this spot, draw a square with a 50 pixel radius around it, now let's take each of those pixels and transpose it over twice the radius and go fill..." sending a long slow string of commands, each computed by the CPU.
When the CPU can offload all of that into a simple "zoom" command to the video chip, the CPU is now free to do other things. Like, respond to your next input, or push the next menu onto the display.
When you have ironclad control over the hardware--it can be a great way to make systems faster. And more stable.
Rred said:
Luis-
"So the hardware acceleration runs throughout the entire OS?"
It isn't so much that the hardware acceleration runs in the OS, but that the hardware itself has certain routines built into it, on the firmware level, so the OS can just call those routines instead of trying to calculate them.
To oversimplify a bit, for instance, a hardware accelerator for "zoom in" might be programmed into the video chip system to automatically tell it "take the 50 pixels around this spot and blow up up to 250 pixels, refresh screen" where the OS would be saying "OK, let's take this spot, draw a square with a 50 pixel radius around it, now let's take each of those pixels and transpose it over twice the radius and go fill..." sending a long slow string of commands, each computed by the CPU.
When the CPU can offload all of that into a simple "zoom" command to the video chip, the CPU is now free to do other things. Like, respond to your next input, or push the next menu onto the display.
When you have ironclad control over the hardware--it can be a great way to make systems faster. And more stable.
Click to expand...
Click to collapse
Great answer. Makes sense, thanks. Now given that this is an Android section lets talk more on that, will it ever be possible to have hardware acceleration on Android, Whether it be through custom ROMs or OEM devices?
"will it ever be possible to have hardware acceleration on Android,"
Possible? Sure, I've seen pigs on the wing.<G> Don't hold your breath for it though. Android is an unruly place where even ordinary hardware is often not supported by the OS and software breaks on every new phone. In order for hardware acceleration to work, the OS needs to have routines and drivers for standard hardware, which means locking down a hardware spec. Which is so very Undroid.
Can't see that happening, unless ten year from now someone invents a "standard universal Android cell phone chipset" and all the manufacturers get paid to exclusively use it. That's the ticket--use our chipset, we'll pay you to use it, and oh, yes, it will play one of "our" ads every time your screen turns on. Or you launch a new app. Or place a call.
(See? Things could get worse!<G>)
Here's an interesting discussion...
http://code.google.com/p/android/issues/detail?id=6914
burtcom said:
Here's an interesting discussion...
http://code.google.com/p/android/issues/detail?id=6914
Click to expand...
Click to collapse
Well as far as I read, it was just a bunch of "me too" and "I agree" lol I got bored reading that I still dont think Google has an official statement on the matter do they?

Editting the hardware keyboard layout

Hey guys,
does someone know a way how to change the layout of the hardware keyboard? I'm not talking about changing the hardware keys, i'm talking about editting a config file or something like this..
For example i want to change my QWERTY-keyboard in a QWERTZ one.
In addition, does someone know how to stop writing a capital latter after a dot. for example something like this: "blub. Blabla" to "blub. blabla"
Thank you very much
try:
http://forum.xda-developers.com/showthread.php?t=1113863
that might be a good place to get started with, searching for things along those lines may yield the result you are looking for.
Edit:
http://forum.xda-developers.com/showthread.php?t=982341
That post will probably be the beginning of your quest. We don't have CM7 on our phones, however it's apparently in development, so this should be easy to apply once that hits.
Meantime, though, you could probably take what they've done and figure out how to make it work for you, now that we have everything we need from HTC to actually work with this device.
I am interested in helping support other countries and languages, germanic languages being my foremost interest, so as I get the time i'd love to try to help you with this.
ty very much. are there any other suggestions?

[Q] Hook and substitute hardware keyboard events

Hi all,
Few days ago I'v repaired HTC Desire Z with Russian keyboard and installed CM10.2 onto it. And of course I want to have working Russian keyboard layout.
Unfortunately only official firmware support it, and problem cannot be solved by editing layout tables because for some buttons there is two Cyrillic letters on one button. There is ruKeyboard application to fix it, but it closed source, so it doesn't acceptable for me.
So, I'm going to develop my application for it (open source, of course) and want to ask some questions... I have a lot of development experience (especially low level, e.g. drivers, MCU's firmware and so on), but never programmed for Android (however I know Java to some degree).
Of course, I can patch android kernel/sources to get my task done, but I suppose that it's a bad idea, because I'll need to port changes to new versions and so on. So, I want to process keyboard events from userspace.
My question: Is it possible to hook all hardware keyboard events (i.e. scancodes, not characters) from userspace, remove them from message queue, and produce new events? I know that producing new events is possible, but what about hooking it (like MS Windows event hooks?). Can you give me a hint (maybe link to example or API, suitable for it)?
Thank you in advance.
FossaFX said:
My question: Is it possible to hook all hardware keyboard events (i.e. scancodes, not characters) from userspace, remove them from message queue, and produce new events? I know that producing new events is possible, but what about hooking it (like MS Windows event hooks?). Can you give me a hint (maybe link to example or API, suitable for it)?
Click to expand...
Click to collapse
I am not a programmer, but I would be interested in an app that could substitute key press events (on my Motorola Droid 4).
Have you heard of the Xposed framework? Maybe this would be a possibility to achieve your goal and Xposed might make things much easier for you.
daniel_m said:
I am not a programmer, but I would be interested in an app that could substitute key press events (on my Motorola Droid 4).
Have you heard of the Xposed framework? Maybe this would be a possibility to achieve your goal and Xposed might make things much easier for you.
Click to expand...
Click to collapse
Thank you, I'll read about it (and no, I didn't hear about it, I have never programmed for Android).
daniel_m said:
I am not a programmer, but I would be interested in an app that could substitute key press events (on my Motorola Droid 4).
Have you heard of the Xposed framework? Maybe this would be a possibility to achieve your goal and Xposed might make things much easier for you.
Click to expand...
Click to collapse
http://www.howtogeek.com/195476/7-t...ramework-on-a-rooted-android-phone-or-tablet/ looks like good thing. So I'll investigate sources of Xposed to look how do they did it.
Good luck!
Would be wonderful for yet another useful Xposed module to see the light of day

Categories

Resources