Android :: SQLite - Detecting Limit Hit?
Oct 11, 2009
I have an SQL which uses something like "LIMIT 100". If the cursor returns 100 rows, is there an efficient way of distinguishing between whether the LIMIT caused it or not? I suppose I could just call LIMIT 101 instead but I was hoping for a nicer way.
View 2 Replies
Mar 23, 2010
I have a query that selects rows in a ListView without having a limit. But now that i have implemented a SharedPreferences that the user can select how much rows will be displayed in the ListView, my SQLite query doesnt work. Im passing the argument this way:
CODE:...................
View 1 Replies
View Related
Apr 22, 2010
I am trying to fetch sms messages from inbox, sent items and drafts. I would like to do a pagination for my list view for that it's imperative that I fetch records in pages/chunks.
I am not familiar with sqlite which is the database I understand android use to store the data. Can someone tell me how can I restrict the number of records I am fetching by using contentResolver.query?
Also what is the way to pull the sqlite database file onto my machine and browse/query it locally to experiment or see data on my machine?
Are there any other better ways to implement pagination in android?
View 4 Replies
View Related
Nov 10, 2010
I'm attempting to create a method that will allow me to retrieve a value from the last row of a database, and then insert it into an EditText field. (This is a value that the user will not change all that often, so it would be helpful if when they do set it, it stays set when they come back to it).
My method, based on a similar method I have for getting the total of a specific column, is as such. code...
If I run the program without this statement, it works fine and the value saves to the db. As soon as I try to run it with this, I get a force close. Any suggestions?
View 2 Replies
View Related
Jul 7, 2010
I have a single bitmap with several individual pictures in (each one is an option) and I would like to detect when the user touches these pictures. I am using the event.getX and event.getY to detect where is pressed, I know the top left X Y and bottom right location of each of the pictures. What is the best way of detecting which one is pressed? (i.e. tieing up the event press and which picture has been pressed?
View 2 Replies
View Related
Jun 3, 2009
There are return values and such that allow handling if SensorManager sensors and location providers aren't available, but what about the camera and microphone for audio recording? Is there a way to detect those in software, or are we just to assume that every device running Android (even the rumored set-top box) is going to have a camera and microphone and try to use them?
In the case of the camera, it would seem that Camera.open() returning null would indicate the lack of hardware. I don't know if that assumption is valid or not, though, considering it isn't documented as such.
In the case of the microphone, though, I don't see anything that could possibly be checked. The same goes for the camera if you're wanting to do video with the MediaRecorder class.
View 2 Replies
View Related
Sep 2, 2009
I'm trying to figure out how my Activity can detect if it was launched by an alias as opposed to by the main icon.
Is it possible to do this?
CODE:............
alias1 and alias2 appear as expected in the Launcher, but I don't see any way in multipleEntryPointTestActivity to tell which of these icons launched the application.
View 2 Replies
View Related
Oct 31, 2010
I have hooked in a ScaleGestureDetector to an OnTouchListener as instructed in Android documentation. For some reason the ScaleGestureDetector does not always detect end of a pinch gesture. This happens mostly when pinching fast from large to small.
The effect is that after I have released both fingers the detector does not fire the gesture end event. If I touch the screen with one afterwards it still thinks I'm continuing the scale gesture (keeps firing onScale events). I have to do another gesture to get the detector to fire end event.
I have added logs to the OnTouchListener and when the scale gesture gets stuck I still get motion events normally when using one finger and event.getPointerCount() is 1.
I have made sure that I don't have any other listeners intervening. View that has the onTouchListener is not the only view on screen but this effect happens also when I'm very careful to begin and end the gesture inside this one view.
Is there any way to improve the end detection?
Or if there a way for me to manually set the ScaleGestureDetector to fire onScaleEnd and change scaleGestureDetector.isInProgress() to false?
View 1 Replies
View Related
Nov 26, 2009
Is there a way to detect whether a image was pulled from the folder res/drawable or res/drawable-hdpi?I am trying to save space and have a program that is using some hdpi bitmaps and some mdpi bitmaps. When an image is placed in drawable-hdpi it automatically replaces the mdpi version. I need to know when this happens beacuseI am using bitamp.resize() to fix the image sizes.The problem is that the getDensity() method (in the if statment after the && ) returns the screen density and I need the original bitmap density. This allays matched the screenDPI and returns false. I have a lot of artwork and do not want to duplicate everything for every size screen. I am trying to just create hdpi bitmaps for the ones that don't look good when re-sized.
View 2 Replies
View Related
Oct 20, 2010
I'm trying to find out if the user is still within range of his own area code. Detecting roaming doesn't solve the problem since the user may still be in the same network with a different area code. I thought about getting the user's coarse location to find the city he's is in but this approach needs Internet access and might not be fast enough (this is done as the user is making a call and needs to finish before the call is made). Is there any way I can do this with just the info from the cellular network?
View 7 Replies
View Related
Jun 6, 2009
I am writing a Security-oriented application for Android that is supposed to detect abuse of SMS sending.
In my work I encountered the problem of not being able to detect outgoing SMSs sent not through the use of conventional applications, i.e. merely by using SMS Manager's sendTextSMS method.
The conventional SMS applications add the contents of the sent SMS to the SMS Provider after they send it but I can assume that malicious applications will not do that... and neither will they provide the pending intents to the sendTextSMS method to be broadcast upon sending/ delivery.
My question is, is there any way I can detect the sending of the SMS without relying on the SMS provider?
View 2 Replies
View Related
Oct 16, 2010
As far as i know there is no way to detect when an outgoing call is accepted at public API level. I can detect incoming calls (with PhoneStateListener), outgoing calls by NEW_OUTGOING_CALL intent, but i can not find a way to distinguish the dialing and connected phone states.
View 4 Replies
View Related
Aug 27, 2010
I was trying to come up with an app that works on the call that a user gets on his phone. For this I wanted to know whether it is possible for me to get intimated when a call comes to the phone and is it possible to intercept the same.I tried to go through quite a few forums but could not get conclusive evidence on how to achieve this.Does anyone have an idea whether this is feasible and if so then how?
View 2 Replies
View Related
Feb 18, 2010
I am testing an android device with eclair using the 2.1 CTS version. When CTS completes a set of tests and restarts the device a "device disconnected" messages appears on the CTS console. However after the device completes the restart to the android home screen CTS does not detect that the device is back online. I have to physically disconnect the USB cable and re-connect it. Do you think this is a device side issue or a USB driver issue on the Ubuntu machine (intrepid) where I am running the CTS?
View 2 Replies
View Related
Apr 1, 2010
I am working on an app that uses a Socket to connect to a controller over TCP. The protocol library was written in Java and I am implementing it in android via a Service. where the Connection class is a Thread that handles the communications with the controller. It's where the Socket lives.I'm using the Preferences mechanism to store the IP and Port. If I feed the Socket the correct IP and Port, the Connection Service works beautifully. However, I am trying to simulate a user entering the wrong information and having the connection fail. The ultimate goal is to present a dialog and offer the ability to "reconnect" or "update settings". However, when I enter a wrong Port number, the application simply hangs.I was under the impression that Threads executed concurrently so I've tried moving the call to start the Connection Service to a Thread, but it still hangs the application.
View 3 Replies
View Related
Nov 21, 2010
I am trying to detect when the physical Menu button on my Android phone has been pressed.I though the code below would work but it does not.Where am I going wrong please?
View 1 Replies
View Related
Feb 9, 2009
I am developing an application on the android platform. The app performs continues WiFi scan and sends information about the list of visible access points to server. However, I need to remove all the Ad Hoc points. The android.net.wifi.ScanResult api does not seem to have any information on "mode" of the network. Is there anyway I can distinguish a given point is Ad Hoc or Master?
View 3 Replies
View Related
May 26, 2009
i'm trying to write a program whichs detects the different states of the phone and mke a different noise in each case.There is a problem that i really don't understand. Please someone can take a look at it and try to explain to ma what's wrong ?
View 5 Replies
View Related
Oct 11, 2010
We are trying to automate our QA process. We make wallpaper apps for Android. Once an app is installed, is there a way to figure out if the application is running since these have apps don't have a main class which we can check by doing a ps on android shell. I think keyboard/language apps would face a similar issue
For eg. If I install tetris and run it. Its main package will show up in shell ps. xyz.abc.Tetris. But the same is not true system apps in android.
View 1 Replies
View Related
Aug 13, 2009
I want to be able to detect where a user has long pressed on my Map Overlay.The idea being to get the GeoPoint of the location the user pressed.I can detect where a user taps, but cannot find how to detect a long press.
View 5 Replies
View Related
Jan 14, 2010
I'm trying to detect the focus/pressed color for button and other elements. This is needed because I'm developing new components and it's important that those look as part of platform. Those colors are ORANGE on android sdk and GREEN on HTC SenseUI. If I could detect that color my component will look as part of platform on both version. Does anyone knows how to do this?
It's possible to create "selector" which uses custom image for default state and platform default for focus/selection. To do this follow the steps:...........................
View 4 Replies
View Related
Nov 12, 2010
Anyone know how I can detect when the Bluetooth audio is disconnected?I want to be able to pause the currently playing audio when it's disconnected,similar to how I do for the ACTION_HEADSET_PLUG intent,but can't figure out how to do it for a Bluetooth device.Any ideas?
View 2 Replies
View Related
Apr 15, 2010
I am running startcts script to run cts testtools . I have run emulator as well as my zoom2 device is also connected to /dev/ttyUSB0 port
When I am doing "adb devices" . it is only showing emulator not zoom2 .
List of devices attached emulator-5554 device
What settings required so as zoom2 will also be detected ? I want to run startcts against zoom2.
View 3 Replies
View Related
Sep 22, 2009
I wrote an application for video recording which stores the recording to a file. Currently I am looking for a way to implement some kind of "listener" to listen for file changes.
The concept I would like to implement is the following: Check the file on a set period of time (for example one second), extract changes (get the data that was written in the last period) and do something with these data.
I would be very thankful if anyone of you could give any suggestion or point to any useful resource that could help to solve the given problem.
View 1 Replies
View Related
Jun 15, 2009
I would like to put a bunch of dots on a google map, and have the appropriate listener called when one of them gets clicked.All i seem to be able to find is to get the location at which the click occurred, and then iterate through the dots until I find one that I think matches. Is there no listener for an arbitrary shape, like a drawable? I feel like this might be a Java question more so than android, but hopefully someone can still answer it.
View 3 Replies
View Related
Sep 10, 2009
I would like to detect shake movement in a service that is running in the background, even when the phone is not currently being used. Is it true that the only way to do this is to hold a wake lock? I suppose this would consume a lot of energy and drain the battery very fast.Is there no way to wake up the phone whenever a shake movement occurs? Maybe with the native sdk? I would imagine the accelerometer causing some kind of interrupt.
View 2 Replies
View Related
Apr 1, 2009
Does anyone know how to detect what primary non-touch navigation method (trackball, dpad, wheel, etc) a device is using within the code?
I know that an app can structure the /res/ folders to detect it like this: /res/ drawable-nonav drawable-dpad drawable-trackball drawable-wheel
But what if I want my app to behave differently depending on the navigation input method- is there a way to do this in the code?
View 3 Replies
View Related
Aug 14, 2009
I want to write an Android application using a mouse (like the way that Windows detects the actions of clicking on a right button and a left button of the mouse). However, I cannot find any library of Android OS detecting these actions.
View 3 Replies
View Related
Nov 11, 2010
I'm developing an Android application.I'm also working with OpenGL graphics.I have a square drawn on the screen and I want to let user move it when he touches over it. In other words, user should be able to move square when he puts his finger on the square.If he touches outside the square nothing happens.How can I detect when user touches over square?
View 2 Replies
View Related
Jun 14, 2010
I know that unfortunately detecting and changing programmatically data connection (GPRS/UMTS) on vanilla Android is not possible, and the common workaround is to edit APN settings. This is hardly a nice solution. However on my device (Xperia X10) I have an additional setting near "data roaming", that allows to enable or disable MMS and data. I suppose that this is a personalization made by Sony Ericsson, and maybe even other vendors have something like this. Is there a way to access this setting?
View 3 Replies
View Related