Best practices listview question - Android Q&A, Help & Troubleshooting

Apologies if this isn't the type of development question that goes on XDA, but if it isn't, could you please tell me where people go with questions like these? I'm working on my first android application and could use the guidance.
I'm setting up a screen with a search that is querying a SQLite file. I want the search to re-run with every letter entered and show the results in a listview. The full list is on the order of 600-700 items, so we're not talking anything huge.
I'm using ADO instead of ORM because I'm much more familiar with ADO, but if there are enough compelling reasons to switch to ORM I'll bite the bullet and do some reading.
So all that explained, what's the right way to filter the list view. Do you re-run the sql query every letter press, or do you directly modify the data supplier which feeds listview?

Related

HowTo ... get answers and contribute

How to get answers efficiently and be helpful at the same time
I have been eagerly following this project for a while now, and gleefully confusing retailers when they see android pop up on my WM phone. There are several people who put in an exceptional amount of effort into this project, and unfortunately there seem to have been an influx of users lately who seem to be fairly effective at frustrating them. Often, instead of seeking answers already clearly identified within this forum and learning from the discussions, they step into an otherwise productive thread and ask to be brought up to speed, or to have their problems solved for them. Usually these individuals are well-intentioned, but are lacking the knowledge both of where to start learning, as well as how to be helpful. I hope this post is helpful in recruiting the many well-meaning new users into becoming active and helpful contributors in their own way, while answering their own questions and solving their own problems at the same time.
I think it's reasonable to assume everyone should do Step 1, and it would be nice if most people would also do Step 2. Step 3 is for individuals with some programming skills and a willing to learn the technological challenges at hand.
Step 1: The Basics, and asking questions well
Many, if not most of us here on this forum are driven here by curiosity, and kept by the challenges faced in this project. When we first start, there often is a very low level of relevant knowledge and understanding.
The very best place to start is the FAQ. It will help orient you to XDAndroid, and will answer many of your questions - so it's a great place to return to and do some reading.
http://xdandroid.com/wiki/Faq​
Next, fortunately, we now have an excellent post by ryannathans on an introduction to Android – SD Card. If you haven’t yet read it, please do.
http://forum.xda-developers.com/showthread.php?t=980079​
You may also be interested in browsing and referring to the XDAndroid wiki:
http://xdandroid.com/wiki/Main_Page​
Finally, a useful thread to read the first few posts, search with your questions, and follow the most recent few pages is the main FRX06 Page. (This will probably change to a new thread when FRX07 is released)
http://forum.xda-developers.com/showthread.php?t=951962​
Once you’ve understood the key elements to getting your Rhodium (aka Touch Pro 2, Tilt 2,e tc) running Android, and know which model phone you have, you should probably install the suggested current base system (FRX06 at the time of this writing). Use it, learn about what works and what doesn’t, and do as much reading about your questions as you can. Almost everything has already been discussed on either XDA Developers or PPC Geeks. On XDA Forums, go to the main rhodium android page (http://forum.xda-developers.com/forumdisplay.php?f=589), and click the 'search this forum' button in the top right.
If you want to look a bit broader, or use a more familiar search engine, use Google, and if you need to, constrain the searches to the given sites (substituting “ThisIsMyQuestion” with your question).
GOOGLE site:http://forum.xda-developers.com/ ThisIsMyQuestion
GOOGLE site:http://forum.ppcgeeks.com/ ThisIsMyQuestion​
Look first, and take the time to read. Even if you don’t find the specific answer (unlikely), you will learn a lot. I found it incredibly helpful to make an account with XDA developers so that I could identify and subscribe to the various important threads and be able to see when there have been new posts on issues I was interested in.
Now, if you still have a question, then find the appropriate thread and ask it. To pose a useful question, you need to be clear, concise, and specific. (Being polite always helps, as well as being patient)
Try to ask your question as simply as possible (ie, how do I enable/do ThisCoolThing on my Rhod 400? I am running FRX06, with _____ modifications on (SD Card / NAND / etc). I’m on Telus/Verizon/etc (CDMA / GSM). It is often a good idea to state what windows is running on your phone (ie, EnergyRom WM6.5, or stock 6.1, etc...), as some of its drivers/settings are occasionally relevant. If there seem to be some situational factor that seems important to you, briefly mention it (ie, everything worked until I did xxxx) If you have gone ahead and done something silly like overclocking your phone, state it, as it may well be a complicating factor. (hint: Don’t. ... At least not in Windows Mobile).
Secondly, try to make sure you get to trying everything suggested to you. Unfortunately, good advice is often overlooked simply because the first item didn’t fix the problem, or the solution seemed too time consuming. You may be asked to delete your data file – don’t worry, you can back it up, and if it doesn’t work, simply replace the new file with your old one. Installing a backup application such as Titanium Explorer (from marketplace) helps backup your apps and their data, speeding their re-installation (and saving you from having to re-download them).
Remember that by participating in this project, by installing new, testing versions, you are not receiving a polished or supported product. You are contributing to a community, and your few hours it takes will pale in contrast to the hours and contributions others have put in. If you do put in this time, as well as do some background reading on the issues and post your findings/solutions, you very likely will help advance the general understanding of the problems at hand.
Step 2: Provide Log Files
This may help you in getting an answer, but to be even more helpful, if your question or problem is new, or is something that hasn’t been solved yet, then having logs will help those answering your question to not fumble blindly. It may even help provide a better build for the next release.
How to get the log files:
Install ADB and DroidExplorer:
http://forum.xda-developers.com/showthread.php?t=1099481​
From your command prompt, after the phone is connected, grab your logs by typing the following:
adb shell dmesg > dmesg.txt
adb logcat -b radio -v time > radiolog.txt
adb logcat -v time > logcat.txt​
You can learn more about logcat, if you're interested, at:
http://developer.android.com/guide/developing/tools/logcat.html
It is then a good idea to edit these logs to remove personal information (ie, your phone number from radiolog.txt (search for it in notepad/wordpad - it's 10 digits, no dashes, in my logs; your email address may appear in the logcat.txt, although I haven't found mine there). To simplify matters, I just do a search & replace for my phone number and email address, replacing them with XXXXXXXXXX.
If you're interested in catching an error in real time, you can omit the storing to file option, and the information will be displayed on the screen, continuing to report until you terminate the process with ^C (control + C)
If your computer isn’t able to find adb.exe, then you may have to either set the environment path to where you installed the android sdk (or where droidexplorer installed it), or simply type in the full path to execute the command
ie: C:\android-sdk-windows\adb shell dmesg > dmesg.txt​
Once you have these files, upload them along with your question (note, the files will be created in the location from which you executed the adb command), and an answer may be found much sooner. If you want to look particularly good, read the logs first, and find the areas that you think are involved. Cut and paste the relevant sections into the body of your question, and say ‘I think the problem is this...’, and you may get an answer even sooner.
Step 3: Cutting edge / bleeding edge
If you’re really eager to help, or are simply really frustrated with a problem and have some coding ability, then this step is for you. First off, know that when you start to play with fire, you may cause problems with your phone, so make sure you keep everything backed up. Titanium Explorer is a common choice to backup your applications and their data onto the SD card, and it may be a good idea to backup the important contents of the SD card too, as they have been known to fail on their own.
If these instructions don’t make sense to you, then think twice if you’re wanting to become involved at this level. This will require some coding ability, and if you want to build it yourself, you`ll need a 64-bit recent linux installation with >1 GB of memory free.
The source code for XDAndroid is located at:
http://gitorious.org/xdandroid (git://gitorious.org/xdandroid/manifest.git)​
And there’s several branches from there that contain the useful areas of development. For example, jbruneaux is working on the new audio routing (and thus you can see/follow/contribute to better solutions there), and Howard Chu is working on a variety of hardware issues.
Useful reading can be found at the XDAndroid Wiki Page:
Getting the Source: http://xdandroid.com/wiki/Getting_the_Source
Configuring the Build: http://xdandroid.com/wiki/Build_Configuration
Building and Packaging: http://xdandroid.com/wiki/Building_and_Packaging​
If you’re eager to help out with coding, spend some time getting familiar with android first, then ask around or pick something that grabs your interest and get working on it. The IRC is a great place to chat with some of the other developers/contributors, and a few others communicate directly with each other about specific challenges.
irc://chat.freenode.net/xdandroid​
The project owner of XDAndroid is Brian Stine, who’s blog often helps give some perspective on what is happening behind the scenes (http://southcape.org/).
Please let me know if there’s any changes you’d suggest to this. My goal is to round out the other guides that have been created with the goal of facilitating clearer communication and increased participation in development.
Great guide!
Couple of suggestions.
It's adb logcat -b radio, not adb shell logcat -b radio. Also, add -v time. Also add regular adb logcat, again with -v time. Also might want to mention the "things to scrub" from these logs - email addresses for example will show up in regular logcats, a whole slew of personal things show up in radio logcats. Seems like a good place to make people aware of that
That's all I have for right now, bravo!
Thanks Arrrghhh,
I had been using adb shell logcat until now, and hadn't noticed I could just use adb logcat - thanks for pointing that out. The -v time is an amazing tag - I wish I had been using that up until now, it's great to isolate when a problem happened. Too bad that's not an option for the dmesg. I've added your suggestions to the post - though I can't seem to find my email address in my current logs.
Cheers.
Great Post!
Hopefully n00bies shall read this
I think "READ THE FAQ" should be included somewhere in Step 1.
Thanks rpierce99, you're right it should be right at the top - and now is.

[Q] Beginner's Guide to Android Software Security Testing?

Does anyone know if there is a Guide/CheatSheet for Security Testing Apps on Android?
I am a software tester and whilst I know my way around security testing for the web, I'm looking for a jump start in Security Testing for Android. Just the basics really, things like how to manipulate text fields, cause buffer overruns etc in Apps.
An example case would be an app which we are developing that allows a user to input free text. I want to be able to prove the point that we need to sanitise the user's input here, so ideally, I'd like to know of a string that I can enter, which will cause an undesired effect on the page which displays the user's input.
eg, In a web page, I enter "<IMG SRC=javascript:alert('Sanitise User Input')>" and an alert is fired on displaying that input.
Like I say, I know my way around this type of thing for the web, but I'm not an Android Dev and I don't know how to manipulate the code with my input.
So, Does anyone have any pointers/source of info/ideas?
Thanks Folks,
Noodoo
(Long-time lurker, infrequent poster)

[Q] Looking for an Interview (Survey?) App

I regularly need to meet with clients at work and end up asking the same questions alot. I then need to generate reports based on my data. I've been looking for an app that would let me replace my pad & paper for a tablet, but I haven't been able to find anything that meets my needs.
I'd be willing to pay up to $150 for this app. I was hoping someone might have a suggestion.
My requirements:
- no cloud required (client records are confidential and therefore must stay local)
- save to csv (or some other way for to get the info into a spreadsheet)
- drop down menus of pre-determined answers available
- check boxes or radio buttons available
- ability to select "other" and input answer with the keyboard
- dynamic Q's (ex: if the question "how many bank accounts do you have?" is answered "none" then the next question, "what are the acct numbers?" is skipped)
After all my digging, all I've been able to find are cloud/subscription based applications. They seem to be a great way for Family Feud to get their data, but not a way to create a report that states "Mr. Smith has $110,231 worth of assets in the following accounts..."
Anyone use something similar at work? Thanks for any insight.

System Managed Devices

Howdy, folks. I hope someone can help answer this question. Mods, if I posted this in the wrong section, please relocate.
I'm helping a friend who is expanding his business by hiring 3 field sales reps and they need to be provisioned with smartphones and tablets for doing quotes, reviewing e-blueprints, accessing email, and so on. So, that's six devices in question, with more to come.
There's a question about whether iOS or Android is the better platform for what we're gong to need. Yes, I know XDA is Android-centric, but this decision isn't about what I want to do, but about what's right for his business. So, your honest input is appreciated.
Essentially, what I think we need is an ACL Management utility of some sort that will support these functions:
Remote access to configure devices in the field
Track and 'nuke' devices if lost/stolen
Remote backup of data/settings
Remote install/configuration of apps by managment
Enforce password protection
Good antivirus/malware/firewall software(?)
Prevent users from installing or deleting data/apps
Prevent users from changing settings
Though I have some technical skills, a 'dashboard' style interface to manage the devices and set a group policy would be preferred. I am aware of Android Device Manager, but I was unable to determine if it will do all of the above that we need.
If you think I've left anything out, please let me know.
Thanks in advance for your help!

Very Basic Question about "Exiting" applications

Before someone starts telling in Passive Agressive mode that "No question is stupid, atleast do a search in threads/ search engine" I would like to clear few things.
1. No my question is NOT about Task managers/ management.
2. Yes I did search and looked for answers.
3. It's just a simple question so please answer in simple terms or guide me to a link which explains the basics to give some relief to a little irksome question which has been on my mind since long.
Now the actual question.
Why the Android OS is designed in such a way that when you stop an app by using back/ home button the application doesn't really quit. As in desktop/laptops OS there's a cross button and we know that the application/ program is actually closed. Why the mobile apps keeps lingering on in the background or task lists. I understand that in mobile environment one needs apps quickly available to him which hardware/ software maker pride themselves towards speed, that capability does count towards camera, browser or one odd app the user thinks he needs readily available. Few apps and games do ask "Are you sure you want to quit". Yes you know and I know those apps sneakily keep updating/ working/ interacting data in the background (trust me this doesn't mean I'm paranoid about battery/privacy/security. I just want to know why). So one simple question "WHY"?. Why Android and it's apps aren't designed in a way where you can actually quit.
Second part of question is why apps "update" so frequently without any visible/significance change? Is it a great conspiracy by internet service providers, app developers and mobile manufacturing businesses. I mean why apps always need updating without much of change.
Thanks in advance.

Categories

Resources