Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Android Programmers on Here?


  • Please log in to reply
9 replies to this topic

#1 RiPPeN

RiPPeN

  • Members
  • 38 posts
  • OFFLINE
  •  
  • Local time:09:48 PM

Posted 27 February 2010 - 07:37 PM

Hey,

Are there any Android programmers on this forum?

-Dan

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:48 PM

Posted 27 February 2010 - 08:19 PM

If you mean Java developers, then yes.

#3 RiPPeN

RiPPeN
  • Topic Starter

  • Members
  • 38 posts
  • OFFLINE
  •  
  • Local time:09:48 PM

Posted 28 February 2010 - 05:45 AM

If you mean Java developers, then yes.


I am having a bit of problem with some code... Android uses SQLite and I run a query...

when i want to search for a SPECIFIC title this is part of the code i use, and it works...

KEY_TITLE + "='" + title +"'"

now for another piece of code i don't want to search for the EXACT title... instead i want it to search for containing letters... i've tried % on both sides and can't figure it out. I've tried all the following to TEST searching for titles containing an "a"...

KEY_TITLE + "LIKE*a*"
KEY_TITLE + " LIKE *a*"
KEY_TITLE + "=*a*"
KEY_TITLE + " = *a*"
KEY_TITLE + "LIKE%a%"
KEY_TITLE + " LIKE %a%"
KEY_TITLE + " = %a%"
KEY_TITLE + "=%a%"

I've also tried all of the above with ' ' on both sides as well... the ones WITHOUT a space just crash the program so i'm guessing they HAVE to have spacing between the LIKE or = and characters i want to search.... anyway.... any help would be appreciated.... hope i make sense...

Thanks in advance,
Dan



EDIT: Nevermind I finally figured it out... stupid error on my part :/ thanks anyway

Edited by RiPPeN, 28 February 2010 - 07:56 AM.


#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:48 PM

Posted 28 February 2010 - 11:36 AM

You forgot the single quotes around the string. :thumbsup:

#5 RiPPeN

RiPPeN
  • Topic Starter

  • Members
  • 38 posts
  • OFFLINE
  •  
  • Local time:09:48 PM

Posted 28 February 2010 - 03:46 PM

You forgot the single quotes around the string. :thumbsup:



shhhh don't tell anyone lol

#6 boopme

boopme

    To Insanity and Beyond


  • Global Moderator
  • 72,740 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NJ USA
  • Local time:09:48 PM

Posted 28 February 2010 - 04:06 PM

Hi,Dan .. good to see you here..
Btw see my new blog post Dan's big mistake LOL
How do I get help? Who is helping me?For the time will come when men will not put up with sound doctrine. Instead, to suit their own desires, they will gather around them a great number of teachers to say what their itching ears want to hear....Become a BleepingComputer fan: Facebook

#7 RiPPeN

RiPPeN
  • Topic Starter

  • Members
  • 38 posts
  • OFFLINE
  •  
  • Local time:09:48 PM

Posted 28 February 2010 - 06:24 PM

i do have another question though... i have some KEY_TITLES that include ' marks.... like That's and This'll.... how do you make it ignore the ' as code and take it as literal? i believe in some programming languages it use to be / before it... like /" and so on... do you know what i mean?

btw this is for SQL

Edited by RiPPeN, 28 February 2010 - 06:24 PM.


#8 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:48 PM

Posted 28 February 2010 - 07:22 PM

You have to escape it by using a \.

It has nothing to do with SQL though. In all languages, when passing an apostrophe as part of a string, it has to be escaped. If you were just using SQL, you wouldn't have to do that. You are using Java to create a SQL string, so it is not quite the same thing.

#9 RiPPeN

RiPPeN
  • Topic Starter

  • Members
  • 38 posts
  • OFFLINE
  •  
  • Local time:09:48 PM

Posted 28 February 2010 - 07:31 PM

You have to escape it by using a \.

It has nothing to do with SQL though. In all languages, when passing an apostrophe as part of a string, it has to be escaped. If you were just using SQL, you wouldn't have to do that. You are using Java to create a SQL string, so it is not quite the same thing.


thank you good sir... i'm sure you'll be hearing more from me :thumbsup:


thanks again

Edit: didn't work :/

heres exactly what i have it do... the person types in an EditText then the app saves and queries and all that good stuff based on what's inside that EditText... so to test your code instead of writing it into the code itself i just put the title as "Title\'s" (with and without quotes).... would that be a good enough test? or do i have to code it into the program itself?

if i didn't make sense with something let me know... thank you for your help

Edited by RiPPeN, 28 February 2010 - 07:42 PM.


#10 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:48 PM

Posted 01 March 2010 - 08:57 AM

I would have to see your exact code because 'doesn't work" doesn't really tell me anything. If there was an error in the way the query was formed, then there should have been an error thrown on execution. If not, then I have to suspect that maybe your database is not built like you think it is. Try hard-coding in a query that you know for sure will work and see what happens.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users