Hey, for an application I am writing I need to use the data which is given in Sensor.TYPE_ROTATION_VECTOR. The bad news are that I program, among others, to my G1 device, which runs Android 1.6, i.e. API Level 4, and not 9 as needed. Nevertheless, I am pretty positive that my phone does have a sort of gyroscope, which means it should be possible for me to get the exact orientation of the phone. So, the question is, how do I do it?
Thank you in advance.
I don't think that the G1 has a gyroscope - it just has the basic accelerometers. Here's an interesting post about how to program to use accelerometers when they are available and not crash when they aren't.
[Update]
If your phone has a gyroscope, you will require Android 2.3 (and above) on the phone to get access to it.
Related
So I been trying to get my first Wear Os watch face published But when I submit I keep it keeps getting rejected. I only lightly changed the Sample Android studio provides nothing much changed but the background and the way the hands move.
I keep getting this.
I really do not know why it keeps getting rejected. I make sure it works for both square and round wear OS.
I keep getting this message
Step 1: Fix the eligibility issue with your app
During review, we detected the following eligibility issue and were unable to accept your app for Wear OS:
The basic functionality of your app does not work as described in App Bundle
Wear OS functionality should work as expected or as described in the app's Google Play Store listing. Please make sure to test your app on a variety of Wear OS devices and configurations.
For example, Hours and Minutes hands are not placed in the center of the watch face on Square Device. as shown/described on the store listing.
I really don't know what to do because I have appealed twice. I asked is it because I am moving the arrows differently. I get the same generic response.
Thank you all for the questions and comments.
I did test the application on sq watches.
And same results I got.
Things started changing when I added a circle into the middle of the screen and that ended up being allowed as center. I have no idea why that would matter I knew it was already centered.
Thanks all.
I am at the beginning stages of a project in which I will be trying to make a hearing aid application for Android. I have wrote a few patches in Pure Data,C sound, and the basic Android sound library which basical take the input from the microphone and play it through headphones. No filtering or amplification.
While Csound gave the best performance, the latency made the tools unusable. I know Android L is suppose to help, but my goal is to create a low cost device hearing assist device. So older phones probably won't get it.
The next idea is to see if I can access the adc and dac values directly, then use C to make my own versions of AudioTrack and Audio record by using the NDK. Basically pointing to the places in memory where these values are coming in.
Is this possible? Also what should I be researching? I can't find anything online about accesses the DAC and ADC directly.
Thank you for your time.
No. "Android" does not provide for direct access by apps to hardware at all.
The NDK does not change that, as you still lack permission to the audio hardware device nodes.
If you have a particular device on which you can install a customized build of Android, then you might be able to do something by adding new APIs or somehow giving your app or a special unix group access to the hardware nodes. But the details of how you might utilize that access would depend on the device chosen.
I have a great idea for an Android app, but as I'm only familiar with php/js, I'm uncertain of which approach I should choose for creating it. The app will be based on a google map with a lot of position markers. There won't be any fancy animations or other heavy resource-demanding activities.
As I see it there are three different options:
Read up on Java and program the whole thing in Java
Create the map activity in Java as a mapview and then use webviews for the other activities (which can easily be scripted as html5 webpages.)
Script everything as a webapp (not really an option, as this is not a real mobile app imho.
I'm most keen on using no. 2 as I'm quite familiar with html/php/js/mysql. Have to read up on the html5 specifics, though. Questions:
I need access to GPS and camera hardware. Is that acheivable in webviews?
How complicated is it to pass variables between js in webview activities and java in other activities?
How big a difference in performance can I expect if I use option 1 vs option 2?
Other thoughts?
Kind regards,
Anders
You can choose number 2, but as we are talking about an android phone, you might want to get really accurate coordinates for your map, and you can only achieve this by accessing your phone GPS, through webviews the best you can get is the location trought the device internet IP adress, wich doesnt lead to a very accurate geo position.
The best choice is a 100% java application in my opinion.
1) Yes it's possible, but as commented it will be less accurate and probably slow.
2) Not complicated. Painful if you need loads of interaction between a webview and native app. Using a Javascript Interface that can be set up from the native app. You can basically inject javascript in a webview's html.
3) Heterogeneity of performance depending on device. Because your implementation will be based on the device's browser you can expect to get really sluggish behavior for older devices. Anything to do with HTML events (Dragging, Tabbing...) will have a knock on most devices, from my experience.
4) As #vodich comments there are other party frameworks. My benchmarking on PhoneGap and other js-based options is that they're a waste of time if you are looking at developing a professional app. I haven't developed on Adobe AIR but find a pain the need to be installing plugins to get native functionality (access to sensors, camera, etc) Mobile is all about fast, responsive behaviour. HDI is your finger, user is fast, so app needs to be fast.
EDIT: So hell yeah! Java FTW!
Albert.
4.Other toughts?
Yes, if you really want to make a great Android app, you should be using only Android and specific Android UI components, and give it a native look and feel. And regarding 1,2 yes it is possible, I would say not so complicated to just integrate them, but I think you'll eventually get in big problems.
Learn Java and write your application natively.
Webviews might allow you to use your php skills to present something to the user, but it's entirely one-way - you'll not be able to interact with what's inside.
The Android developer site offers fantastic documentation and jumping from PHP to Java isn't greatly difficult, though you'll need to get used to strict typing and "real" OOP.
Other thoughts? Don't go down the PhoneGap/Cross platform toolkit road - it might allow you to write applications for multiple platforms and using your current skills, but in the end you get a subpar app that doesn't feel right on either platform and doesn't fair well as future versions of iOS and Android are released.
I'm just getting started with Android Dev.
Which Android phones should I add as virtual devices to make sure that my apps will work for the majority of people?
The only articles I've found from google were written 2 years ago, and I think the market share must've changed quite a bit by now, hence the phones listed there might no longer be in use as much.
Specifically I'd like to know which screen dimensions + Ram/memory I should provide to the phones for testing.
if your question is about which Android versions you want to support, you should check this link.
So basically you can use eclair (2.1) has the minimum supported version.
I highly recommend that you target the last version (Jelly Bean at the moment). It is a pretty good practice and this way you won't have to update your app to adapt it when JB will become more popular..
For my tests, I usually have a virtual machine with eclair or gingerbread and my phone with Jelly Bean.
edit : one very important clarification, in your app manifest. You will have to declare the minimum android version you support with android:minSdkVersion="XXX". the tag android:targetSdkVersion="XXX" is not here to tell on what version you are focusing, but to tell to the system if you have thought about the last versions. so you should always target the last one (16 at the moment). If for example you target gingerbread (api level 9 I think), then the terminal will assume that you did not adjust to the disparition of the menu button and display one, EVEN IF you don't even use it !! It is a very poor user experience.
As for the screens size to support, This link is very helpful (and whenever you have a question about android development the official website should always be your first destination). I think that the question is not really here are the screen sizes, let's make a layout for each one of them, but the contrary : here is how I want to display my app on a standard size phone (around 4.2" inches I would say), at which point in terms of dp do I need another layout because mine is either too cramped or has too much whitespace ?
If you really want to know what sizes to consider, somewhere between 4 and 4.5 inches is where you will find most high end smartphones of 2012. You will maybe need another layout for 3.5" or smaller screens.
In the superior dimensions, I would focus on 7" (Nexus 7, kindle, galaxy tab 7) and 10".
Is it possible to write an Android Application to be used on an Android OS Mobile Phone that can RECEIVE (not worried about transmitting) on a frequency between 120-130 MHz range? I've seen an option with an Arduino Board, and also saw something about using the NDK. Would I have to be using a language like C for lower level hardware programming to integrate with the Java parts of the Android Mobile Application? I would prefer to just use the hardware on board with most Smart Phones, specifically a Motorola Droid Bionic.
Thanks! I just finished digging more. The receiver on most phones, including the Droid 3 and Droid Bionic don't receive on a higher frequency than 108 MHz. I also ended up wiki-ing the software-defined radio deal. Very cool stuff that will hopefully end up coming to our mobile phone technology. I got an FM tuner at phandroid.com/2011/09/12/… . That's as good as you can get apparently :P (You CANNOT choose to recieve on a specific radio frequency on an android phone)