Re: [codenameone-discussions] Re: How to save byte array as a file in android and how to view that file in codenameone?

2018-02-13 Thread Shai Almog
Why are you calling Resources.open?
Try Display.getInstance().execute().

Resources.open works with "resource files" not files.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/dc5fc967-545a-4158-bc66-1ada4ede2cb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Slow results with dynamic AutoCompleteTextField

2018-02-13 Thread Shai Almog
Hi,
sure. I demonstrated this in the online courses but this is a pretty simple 
strategy.

Keep a variable called timer of type UI timer and whenever you get an event:

- If you have a timer just cancel it
- Create a new timer to send the event in 500ms or even 1 second.

That way you create a delay that lets the user keep typing.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/73f7696a-cb33-483d-b070-d4952f98c527%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [codenameone-discussions] Re: How to save byte array as a file in android and how to view that file in codenameone?

2018-02-13 Thread kantharao512
Sorry for late reply Steve..
here is the full stack trace

Resource not found: 
file:///data/data/com.mypackage.myapp/files/MyFileName.pdf
java.io.IOException: 
file:///data/data/com.mypackage.myapp/files/MyFileName.pdf not found
 at com.codename1.ui.util.Resources.open(Resources.java:740)
 at com.codename1.ui.util.Resources.open(Resources.java:679)
 at 
com.mypackage.myapp.MyFileNameForm$1.actionPerformed(MyFileNameForm.java:158)
 at 
com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:349)
 at com.codename1.ui.Button.fireActionEvent(Button.java:499)
 at com.codename1.ui.Button.released(Button.java:533)
 at com.codename1.ui.Button.pointerReleased(Button.java:637)
 at com.codename1.ui.Form.pointerReleased(Form.java:2980)
 at com.codename1.ui.Component.pointerReleased(Component.java:4100)
 at com.codename1.ui.Display.handleEvent(Display.java:2061)
 at com.codename1.ui.Display.edtLoopImpl(Display.java:1043)
 at com.codename1.ui.Display.mainEDTLoop(Display.java:961)
 at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
 at 
com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
 at java.lang.Thread.run(Thread.java:841)

and i forgot to mention that , while trying to open file using below code 
getting this exception.. 

try {
Resources.open(fs.getAppHomePath() + "MyFileName.pdf");
} catch (IOException e) {
e.printStackTrace();
}


but still don't know it is saving or not..


On Tuesday, February 13, 2018 at 6:04:12 PM UTC+5:30, Steve Hannah wrote:
>
> It is very strange that the IOException is reporting the path with the 
> file:/// prefix.   This should have been stripped by the time it gets 
> there.  Can you post a full stack trace?
>
> On Tue, Feb 13, 2018 at 1:09 AM,  
> wrote:
>
>> Thanks shai for reply.. I have tried "fs.mkdir(fs.getAppHomePath());" 
>> like below but still i'm getting  
>>
>>> java.io.IOException: 
>>> file:///data/data/com.engravsystems.emqim/files//MyFileName.pdf not found ..
>>>
>>
>> here is the code :
>>
>>   FileSystemStorage fs = FileSystemStorage.getInstance();
>>
>> try {
>>
>> if(!fs.exists(fs.getAppHomePath()))
>> fs.mkdir(fs.getAppHomePath());
>>
>> OutputStream os = 
>> fs.openOutputStream(fs.getAppHomePath() + "MyFileName.pdf");
>> 
>> os.write(hrFiles.get(finalI).get("fileData").toString().getBytes());
>> Util.cleanup(os);
>> } catch (IOException e) {
>> e.printStackTrace();
>> }
>>
>>
>>
>>
>> On Tuesday, February 13, 2018 at 10:45:10 AM UTC+5:30, Shai Almog wrote:
>>>
>>> I think your code is correct. I think that app home might not exist 
>>> which seems to me like an omission on our part. 
>>> Try 
>>>
>>> fs.mkdir(fs.getAppHomePath());
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "CodenameOne Discussions" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to codenameone-discussions+unsubscr...@googlegroups.com 
>> .
>> Visit this group at 
>> https://groups.google.com/group/codenameone-discussions.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/codenameone-discussions/546eb817-a1d9-486b-a507-28d94a4a1f86%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Steve Hannah
> Software Developer
> Codename One
> http://www.codenameone.com
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/64393a3b-a82e-47ab-92bd-00726ecd7e9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: new ios build glitch: "Invalid code signing entitlements"

2018-02-13 Thread Dave Dyer
I did another build, no changes at all, and this one went up fine.
I still have both packages, if there's anything you'd like to know
about what was different in the ipa

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/7c9178ec-63cc-4915-9d8f-fa059d2d0214%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: new ios build glitch: "Invalid code signing entitlements"

2018-02-13 Thread Dave Dyer

You're gonna love this.  I did another build, and this one went up fine.  
Looking through
my catalog of possible screwups, it's just possible that the previous build 
was a dev
build instead of an app store build.  If so this is an odd way to be told.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/22a24414-c814-455c-acb1-51afbae16f61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Slow results with dynamic AutoCompleteTextField

2018-02-13 Thread rdvg1962
Hi,

Load about 25k of records in a table called "articles".

To do the dynamic search of the information, I made a select to the table 
using the "like" function. Perform a test by entering the word "salsa". For 
each letter the routine goes to the BD and brings "n" number of records. 
For example: When registering the "s" character, 23k registers come, when I 
type the "a" they come 15k registers .

My intention is to type the word "salsa" but the results can take up to 3 
minutes.

Is there any way to request the information to the BD when you already 
complete the word "salsa" and not for each character?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/1915741d-7542-420e-a6fd-8c23a986913a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [codenameone-discussions] new ios build glitch: "Invalid code signing entitlements"

2018-02-13 Thread Steve Hannah
Sounds similar to this issue:
https://stackoverflow.com/a/27724780/2935174

On Tue, Feb 13, 2018 at 1:31 PM, Dave Dyer 
wrote:

>
> Yesterday all was well.  Today uploading a new build to the app store I get
> the error "Invalid code signing entitlements" Specifcially the value "*"
> for
> key com.apple.developer.associated-domains is not supported.
>
> there is some traffic on stackoverflow that seems to be relevant
> https://stackoverflow.com/questions/28106791/error-itms-
> 90164-90046-invalid-code-signing-entitlements
>
> --
> You received this message because you are subscribed to the Google Groups
> "CodenameOne Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to codenameone-discussions+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/
> group/codenameone-discussions.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/codenameone-discussions/175ce898-34f9-43cd-ace4-
> d9f7c2a09f80%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Steve Hannah
Software Developer
Codename One
http://www.codenameone.com

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKUe-qrYvVpC4EtURLwnzU4F16vp%2BQvWU%2BkFhtUudGi8mA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] new ios build glitch: "Invalid code signing entitlements"

2018-02-13 Thread Dave Dyer

Yesterday all was well.  Today uploading a new build to the app store I get
the error "Invalid code signing entitlements" Specifcially the value "*" for
key com.apple.developer.associated-domains is not supported.

there is some traffic on stackoverflow that seems to be relevant
https://stackoverflow.com/questions/28106791/error-itms-90164-90046-invalid-code-signing-entitlements

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/175ce898-34f9-43cd-ace4-d9f7c2a09f80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: How to save byte array as a file in android and how to view that file in codenameone?

2018-02-13 Thread kantharao512
Thanks shai for reply.. I have tried "fs.mkdir(fs.getAppHomePath());" like 
below but still i'm getting  

> java.io.IOException: 
> file:///data/data/com.engravsystems.emqim/files//MyFileName.pdf not found ..
>

here is the code :

  FileSystemStorage fs = FileSystemStorage.getInstance();

try {

if(!fs.exists(fs.getAppHomePath()))
fs.mkdir(fs.getAppHomePath());

OutputStream os = 
fs.openOutputStream(fs.getAppHomePath() + "MyFileName.pdf");

os.write(hrFiles.get(finalI).get("fileData").toString().getBytes());
Util.cleanup(os);
} catch (IOException e) {
e.printStackTrace();
}




On Tuesday, February 13, 2018 at 10:45:10 AM UTC+5:30, Shai Almog wrote:
>
> I think your code is correct. I think that app home might not exist which 
> seems to me like an omission on our part. 
> Try 
>
> fs.mkdir(fs.getAppHomePath());
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/546eb817-a1d9-486b-a507-28d94a4a1f86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.