Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
youngjun
Posts: 40
Registered: ‎09-03-2008
My Device: Not Specified

How to detect string pattern in html email

I added a new StringPattern to StringPatternRepository and noticed that the pattern match only works in plain text emails, not html emails. The pattern I am try to match is a simple text "JUNEYOUNG". After put some debug output in the findMatch function, I found out that only in  plain text email that the email content is passed to findMatch function. In html format email, only the subject is passed to the function.

 

Could someone advice how to detect string pattern in html format email?

 

Thanks,

 

June

Please use plain text.
Administrator
MSohm
Posts: 14,238
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: How to detect string pattern in html email

What BlackBerry Smartphone model and BlackBerry handheld software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
youngjun
Posts: 40
Registered: ‎09-03-2008
My Device: Not Specified

Re: How to detect string pattern in html email

I was testing on BlackBerry 9000 , V4.6.0.162.

 

June Young

Please use plain text.
New Developer
marksgnga
Posts: 2
Registered: ‎07-10-2009
My Device: Not Specified

Re: How to detect string pattern in html email

 

I have the same issue in HTML email.

 

Tried with:

   8900 device v4.6.1.231 (Platform 4.2.0.108) ATT

   8320 device v4.5.0.81 (Platform 2.7.0.78) TMO

 

I tried both example apps from:

http://www.blackberry.com/knowledgecentersupport/kmsupport/supportknowledgebase/files/ZipCodeLookupS...

 

In all cases I have to "Get Plain Text" for the patterns (5-digit numbers) to be recognized and the MenuItem to show up. 

 

 

Also, should patterns also be matched/highlighted in the Browser like phone numbers are ... or is the Browser a 'special' case?

 

 

Thanks!

Mark

Please use plain text.
New Developer
marksgnga
Posts: 2
Registered: ‎07-10-2009
My Device: Not Specified

Re: How to detect string pattern in html email

Is this thread dead???

 

Please can someone tell me if this is a bug in how the PatternRepository works or is there some way to get patterns to highlight in HTML emails.

 

Thanks in advance for 'any' reply!

Please use plain text.
New Developer
redbutt
Posts: 37
Registered: ‎03-02-2009
My Device: Bold 9700
My Carrier: TMO

Re: How to detect string pattern in html email

[ Edited ]
I've noticed this exact same thing...I'd also like to know...so could anyone from RIM reply (especially about the fact that the patterns don't seem to work in browser content)?  I'm seeing this on a 9000, 8900, 9530, 9630, etc....it's not isolated to a single phone.
Message Edited by redbutt on 07-24-2009 01:02 PM
Please use plain text.
Administrator
saziz
Posts: 76
Registered: ‎07-11-2008
My Device: Z10
My Carrier: SingTel

Re: How to detect string pattern in html email

For performance, we don’t support third-party StringPatterns in HTML. However, some possible alternatives you could use are:

 

BrowserContentProviderRegistry (See BrowserPlugin sample within the JDE)

HTTPFilter (See HTTPFilterDemo sample in the JDE). 

Sarim
BlackBerry Development Advisor
www.BlackBerryDeveloper.com
Please use plain text.
New Developer
thrusty
Posts: 3
Registered: ‎09-18-2009
My Device: Not Specified

Re: How to detect string pattern in html email

saziz, can you elaborate on how to use BrowserContentProvider to achieve roughly the same effect as with StringPatterns?

It appears that you would need to create a new HTML renderer just to detect clicking on links?

 

 

Please use plain text.