Android :: Code Which Would Be Much Easier Implemented As ArrayList
Apr 3, 2009
I notice in the source code they are not used in critical loops, e.g. in View.java :
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
I can see this kind of code which would be much easier implemented as an ArrayList :
1867 private void addInArray(View child, int index) { 1868 View[] children = mChildren;
1869 final int count = mChildrenCount;
1870 final int size = children.length;
1871 if (index == count) { 1872 if (size == count) { 1873 mChildren = new View[size + ARRAY_CAPACITY_INCREMENT];
1874 System.arraycopy(children, 0, mChildren, 0, size);
1875 children = mChildren;
1876 } 1877 children[mChildrenCount++] = child;
1878 } else if (index < count) { 1879 if (size == count) { 1880 mChildren = new View[size + ARRAY_CAPACITY_INCREMENT];
1881 System.arraycopy(children, 0, mChildren, 0, index);
1882 System.arraycopy(children, index, mChildren, index + 1, count - index);
1883 children = mChildren; 1884 } else { 1885 System.arraycopy(children, index, children, index + 1, count - index);
1886 } 1887 children[index] = child;
1888 mChildrenCount++;
1889 } else { 1890 throw new IndexOutOfBoundsException("index=" + index + " count=" + count);
1891 } 1892 };
View 3 Replies
Jun 18, 2013
create to get ads on my free application, ok first off I have been following this book
Beginning Android games 2011
Beginning Android Games
Now this book implements a very nice and simple game framework which I use (a simpler version can be found here.The Android Game Framework: Part I - Kilobolt
Now this framework doesn't use any type of XML file what so ever, it uses a framebuffer to draw things onto the screen. now when the application is first started, this is the first method called which is in the AndroidGame.java
[HIGH]
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
[code]...
View 1 Replies
View Related
Nov 11, 2010
What is this widget called (the one with the three buttons).
View 4 Replies
View Related
Jun 16, 2009
I've been looking around in the framework source and I can get my head around some things. For instance, in the ScrollView, the animated scrolling is done by using computeScroll(). To make the screen redraw (and thus call computeScroll() again), postInvalidate() is used. Why is that one used, instead of a regular invalidate-call?
Secondly, I wonder some things about the Animation framework. I know how a ViewGroup is responsible for animating the children (modifying the Canvas and so on), but what drives the animation, i.e. what makes the screen redraw over and over again? In the case of the ScrollView, it's the call to postInvalidate() made from computeScroll(), but what is it in the case of an Animation?
View 3 Replies
View Related
Sep 13, 2010
I mean in runtime. Sometimes I get "called unimplemented OpenGL ES API" error but it can not be catched. Is there a way to figure out what function is implemented or not, in runtime?
View 2 Replies
View Related
Oct 21, 2010
Can somebody point me to the right direction how the navigation overlays for My Tracks are implemented? I'm talking about the "buttons" for navigating appearing on the left and right side if you tap on the screen. Any pointers?
View 3 Replies
View Related
Jan 29, 2010
How to include .jar files in android for a particular application in which KSOAP is implemented?
View 2 Replies
View Related
Mar 3, 2009
Is it possible to build a spreadsheet-like grid? I would like to select single cells, or one row at a time,like a database viewer.
Or would it need to be implemented at the framework level?
I'm thinking of a UI equivalent of something like this AJAX control, which may be opened in the WebView: http://www.hisdigital.com/misc/flexigrid/.
View 2 Replies
View Related
May 15, 2013
I have seen several 2DIN car headunits that has Android 2.3 supports FM Radio and Handsfree and can be controlled through the UI itself. how is it implemented?
eg: In eBay, search for item No : 130862564199
View 1 Replies
View Related
Dec 31, 2009
I have had my droid for a couple of days now, and just recently have started to get more into it. Went to the app store and noticed there was an update for a couple of the apps that I had installed. that got me wondering, what if i have a large amount of apps, I would then have to search for them individually in the store to update them! This seems like it would be a total pain. Im I just doing something wrong, like a setting or a menu im not seeing? Or is there an app that can find updates for apps that I have installed? Ive seen app managers but all fail to mention any sort of automatic updates of any kind.
View 9 Replies
View Related
Nov 12, 2009
I'm trying to figure out how to parse some XML (for an Android app), and it seems pretty ridiculous how difficult it is to do in Java. It seems like it requires creating an XML handler which has various callbacks (start Element, end Element, and so on), and you have to then take care of changing all this data into objects. Something like this tutorial.All I really need is to change an XML document into a multidimensional array, and even better would be to have some sort of Hpricot processor. Is there any way to do this, or do I really have to write all the extra code in the example above?
View 11 Replies
View Related
Apr 25, 2010
I have an A4 document only with text. Is it possible to reduce the size of the pages e.g. with reducing the amount of words per line?
View 2 Replies
View Related
May 14, 2009
I want to add one more endpoint audio device in android and am trying to modify the setRouting() functions to support the selection of the new added audio device. As far I traced, the doRouting() in class AudioHardwareOss should perform the audio endpoint device selection. However, donRouting() just returns NO_ERROR without any other functionalities. So, my question is where and how endpoint audio device selection is achieved.
View 2 Replies
View Related
Sep 25, 2010
I have an application that has a tabActivity and 3 tabs. all off the tabs use a location listener and work with locations. i implement onPause and onResume for every tab to remove and start listening for location accordingly. is this the right way to go? i had another idea to work with and that was implementing a location listener to the tabActivity and doing broadcasts to the child tabs with the location, but it seemed more complicated.
The problem with my current solution is that whenever i switch tab i lose the location i got in the previous and i cant use getlastknown location because i dont want the last location on start of the application.(does this make sense?) what can i do to solve this problem. a thing that will work better will be to have one variable that will hold the last location from the onLocationChanged and i can observe its changes and call methods onChange.
View 1 Replies
View Related
Dec 21, 2009
I'm sure a lot of us using the Droid are coming from a BlackBerry. Well here is what I miss: Being able to skip tracks by just holding down the +/- Volume for 2 Seconds. (Instead you have unlock the screen and hope you're still in the app for your media player.) Flip to your next picture with a flick. This was fixed with "Multi-Touch Gallery for Droid" A facebook app that lets you check Live Feed and your Inbox.
^Same thing for MySpace Custom LED color for different Alerts.
View 3 Replies
View Related
Aug 12, 2010
I placed an image in each List View Item at the right side,In the layout xml,I set its width and length as 20dip ,kind of small,and I find it is hard to click at it cause the image only occupied 20*20 dip,I hope the length of it doesn't change,while its height full filling the parent,
I tried :android:layout_width="20dip"
android:layout_height="fill_parent"
but it doesn't work. Below is my xml:
<Relative Layout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="6dip"
android:background="#FFFFFF">
<Image View android:id="@+id/avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin Right="6dip"
android:src="@drawable/default_happy_face"/>
View 2 Replies
View Related
Oct 26, 2010
I am looking for a way to create a shortcut or perhaps an App that will allow me to pair/connect with devices easier. I hate that I have to go through the following path to do this: Menu/Settings/Wireless & Networks/Bluetooth Settings/Select Device. I would love to be able to add a shortcut on my homescreen that would allow me to pair with a specific device. Or maybe a widget that lists your devices so you can just tap the one to connect with. My car will connect automatically but other devices won't.
View 2 Replies
View Related
May 22, 2010
Are we allowed to return 30 days from the day we ordered the phone, or 30 days from when we received the phone? (april 19th and april 28th for me). If the droid 2 is coming out with similar specs and a keyboard i think i want that.
View 10 Replies
View Related
Aug 26, 2010
The way I do it is a full backup with my backup pro, wipe the phone completely, wipe the a2sd partition, clear the dalvik etc., load new ROM and then proceed to re install everything from backup but my god what a fudge about. Is it really necessary to wipe everytime? I see people talking about changing ROMs often so do you really go through this every time or am I just being over cautious?
View 7 Replies
View Related
Apr 17, 2010
How can reduce the power usage in my application.
View 1 Replies
View Related
Jul 5, 2010
Lets say you do a factory reset of your phone and want to put all your apps back on, you have to install each one individually with TB? I was hoping Titanium Backup worked kind of like Nandroid in that it just restored everything on it's own, or at least install the apps on it's own without you having to sit there and click install for each one. BTW I only have the free version.
View 17 Replies
View Related
Jun 28, 2010
I don't want to say that this program is useless. It's just that I haven't found a use for it personally. Apparently, a lot of people out there like it. But why? I know that I am missing something.You can search for roms. I can do that with google.You can reboot into recovery. You can do that buy holding the up-volume button.You can automatically install a rom from the SD card. No you can't. I tried and all the app did was reboot my phone into recovery.You can install a rom using a picture. What? There MUST be a way to install a ROM using ROM Manager without the need to plug into the desktop. Could somebody out there please educate me?
View 19 Replies
View Related
Nov 6, 2012
My developer does math for matching dimensions between the screens I (the designer) give and the layout she makes. There is a formula for it, but she forgets after a project is over and she has to start all over again. Is there anything I can do as a designer to minimize her head banging hours. Is there a certain formula or layout I should design around to make things a bit easier for her.
View 4 Replies
View Related
Apr 22, 2010
I am implementing one application gust i am adding validations in login page implemented then two fields required username and password button login i am applying validations then focus are not getting then set focus in unfilled edittext
CODE:.............
Not filling username then filling password then username entered some toast displayed fine focus are entered in username edittext this is the problem how can implemented focus in unfilled username.
View 2 Replies
View Related
Jun 19, 2010
i'm a bit stuck with remote services in android. thing is i implemented a remote service in package "a.b.c" and i want other applications to be able to access this service. i got rid of the whole crappy aidl-stuff and designed the "interface" of the service to work via broadcasted intents. works fine so far...
problem is: how do i get a different application (different package, different project, maybe even a different developer, ...) to start/stop the service?
CODE:..........
This will crash my app immediately on startup. what did i do wrong? how will i get this to work?
once it's running, commands and data will be passed via broadcasts. so that should be no real problem...
View 1 Replies
View Related
Jul 11, 2010
Has anyone implemented an Android Shake Detector that works well on most phones?I thought it would be fairly simple to implement but I keep getting false results. Basically, what I'm doing is setting up a sensor Listener, checking to make sure it is a SensorManager.SENSOR_ACCELEROMETER event, then only checking the event if the last event I received was more than 50 milliseconds ago (to try to reduce the amount of checking I do).Then I look for 3 "Shakes" within 4 seconds.A "Shake" to me being a speed reading of over 1000 followed by a speed reading of less than 400 within 1 second. If I don't get three "Shakes" within 4 seconds then the counter is reset to zero.At times it seems to work well but I continue to have instances where I just pick up the phone, and it triggers all three shakes, which makes very little sense to me because at other times, I can physically shake the phone quite hard, and not trigger all three shakes.As I said.. it works about 90% of the time correctly, but a 10% error rate is making the feature I want to implement useless.
View 5 Replies
View Related
Nov 13, 2010
Any way to quickly hit a button to mute the phone when you go to sleep? Don't like my phone ringing when I am sleeping. On my G2 I just hold the power button and the mute option pops up. Or if I power on I can slide it to the right which mutes the phone. Side it left and it powers on. My gf has the HTC Desire Z I cant seem to find it. Only way I found out was to adjust the volume to lowest setting but this takes time there must be an easier way.
View 3 Replies
View Related
Jun 1, 2010
hey guys. I'm still pretty new at this rooting stuff.I've been playing around with different roms and fun things like that.Lately I have been using the latest CM.I like it, its cool but seems a bit buggy to me. I've OC'ed to 1ghz, but it still runs rough and a little laggy in between screens.I moved to Android from the iPhone, and I know one thing that would happen with jailbreaking is if you get too many jailbreaks going it can cause bugs.I'm worried now that I've been playing around with lots of roms and making backups and stuff that I may just have too much going on. So I would like to start over.I dont have anything on my phone I'm too worried about.I have Titanium backup to back up apps and whatever else.It would be nice to backup my SMS and MMS, so I am using the trial version of MyBackup.Besides that I'm not too worried about losing anything.
So if I just want to start over with a clean rom install and lose the old rom backups, etc what would be my best bet?I think I'm going to flash BB with 1ghz kernel.Unless there are any other suggestions.Also, is there an easier way to keep my SD card organized? Just looking through it seems very messy.
View 6 Replies
View Related
Jun 6, 2010
Is there an easier way to swype a word that has two of the same letters in it other than peck typing? For example, too or toon or root, you get the idea.
View 10 Replies
View Related
Aug 17, 2010
I have used RSD Lite before to re-root my phone after applying 2.1 so I am comfortable using it again. I was just wondering if there is an easier way to unroot my phone. I know all of you are saying why unroot? Well I really don't utilize the root at all anymore. I originally did it to change the status bar to black (this is prolly the only thing that I will miss), to be able to downloas Led Hack (I recently uninstalled it and it appears that the leds turn off now in 2.2, I dunno if that was fixed in 2.1), and for wireless and wired tether (pdanet works without rooting and I have never once used the wireless tether other than to they and see if it works. It seems that I have had more problems with rooting then when my phone was unrooted.
Yea my phone is faster now bc of OC but unrooted it wasn't that slow anyway and I don't know if anyone else is having this problem but I get email notifications all the time even when I do not have a new email and it is really bothering me. So after that rant I was just wondering if there was an easier way to unroot. I tried downloading the rom from rom manager verizon 2.0.1 stock without root odexed and it gave me some error when installing. So if I have to use RSD Lite I will I was jsut wondering if there was an easier way. Also since I will not be rooted anymore is there any other program out there that saves data other than TiBu? I take it I will not be able to restore data with TiBu being unrooted. Don't know if this matters with RSD Lite but right now I am on BB 0.4 using chevy 1g kernal with the most updated baseband of .01P
View 9 Replies
View Related