B4A Library Parse Library – Push Notifications and Cloud Storage

SueHale

Member
Licensed User
Longtime User
Hi All,

I understand Parse is running as a service, is it possible to use this within another Service module and not an Activity?

Would it also be possible to integrate one of the custom Notification libraries instead of the standard Android system Notification system?

Thanks
Sue.
 

touchsquid

Active Member
Licensed User
Longtime User
Hi agraham

I sent you some beer money via Paypal for your excellent libraries. I wonder if you could answer my previous question about the ParseUser object.

Thanks from the Squid!
 

agraham

Expert
Licensed User
Longtime User
Sorry, I've only just found your post above and also didn't see the previous question. The forum doesn't seem to be sending me emails as it should I thought it had gone quiet recently! I've just asked Erel if there is anything he can check that might be causing this.

First - thanks for the donation. I am afraid that at the moment I am not doing any Android work and am not likely to do so in the near future. Erel does have the source for the Parse library so if anyone wants to have a go at adding and testing ParseUSer I am sure Erel would be happy to provide the code.
 

touchsquid

Active Member
Licensed User
Longtime User
Thanks. I will have someone else look at it.
 

mhartwig

Member
Licensed User
Longtime User
FYI, I was using this lib and the Parse API. I have not released my app yet. I have decided to refactor it to use http://quickblox.com/.

They offer unlimited API calls and 10gigs of storage. VS 1,000,000 API calls and 1gig of storage with Parse.

No B4A lib yet, but they do support REST.
 

boten

Active Member
Licensed User
Longtime User
Trying to retrieve count using:

B4X:
qry.Initialize("MyClassName")
qry.Count("countme",999999)

app crashes with error.
countme_DoneCount event never fired.

Must say that it didn't happen before (App was NOT changed!!) - only number of records of said class is now over 40,000

log error msg is:
B4X:
java.lang.NullPointerException
   at com.parse.ParseQuery$15.then(ParseQuery.java:746)
   at com.parse.ParseQuery$15.then(ParseQuery.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.access$8(Task.java:435)
   at com.parse.Task$6.then(Task.java:309)
   at com.parse.Task$6.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.ParseCommand$4.then(ParseCommand.java:357)
   at com.parse.ParseCommand$4.then(ParseCommand.java:1)
   at com.parse.Task$11.run(Task.java:474)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.continueWith(Task.java:316)
   at com.parse.Task.continueWith(Task.java:327)
   at com.parse.Task$11.run(Task.java:478)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.access$8(Task.java:435)
   at com.parse.Task$6.then(Task.java:309)
   at com.parse.Task$6.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.continueWith(Task.java:316)
   at com.parse.Task.continueWith(Task.java:327)
   at com.parse.Task$11.run(Task.java:478)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$3.run(Task.java:227)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)


   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
   at java.lang.Thread.run(Thread.java:1096)
Message longer than Log limit (4000). Message was truncated.
 

LucaMs

Expert
Licensed User
Longtime User
I take advantage of the fact that the expert Agrahm is online.

I gave it a cursory glance at the site Parse.com.

It scared me to find that you must (or can?) save key / value pairs.

Before I lose myself in this new adventure, can you reassure me? Can I run updates in a simple way as a conventional db server?

Thank you in advance

P.S. Any comment/help is welcome, this is not a personal message to Agraham
 
Last edited:

boten

Active Member
Licensed User
Longtime User
unfilered log:
B4X:
** Activity (main) Create, isFirst = true **


Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.


GC_EXTERNAL_ALLOC freed 3920 objects / 272728 bytes in 256ms


** Activity (main) Resume **


GC_FOR_MALLOC freed 4031 objects / 237696 bytes in 138ms


Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@450e4838 (uid=10067 pid=762)


Client not active, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4506c070


Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.


Launch timeout has expired, giving up wake lock!


Displayed activity boten.KsHof/.main: 10320 ms (total 10320 ms)


GC_FOR_MALLOC freed 5303 objects / 363600 bytes in 365ms


Freeing OpenSSL session


GC_FOR_MALLOC freed 341 objects / 18288 bytes in 233ms


Activity idle timeout for HistoryRecord{4505dac8 boten.KsHof/.main}


GC_EXPLICIT freed 50 objects / 2400 bytes in 14450ms


GC_EXPLICIT freed 1852 objects / 95792 bytes in 207ms


Shutting down VM


threadid=1: thread exiting with uncaught exception (group=0x4001d800)


java.lang.NullPointerException


   at com.parse.ParseQuery$15.then(ParseQuery.java:746)
   at com.parse.ParseQuery$15.then(ParseQuery.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.access$8(Task.java:435)
   at com.parse.Task$6.then(Task.java:309)
   at com.parse.Task$6.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.ParseCommand$4.then(ParseCommand.java:357)
   at com.parse.ParseCommand$4.then(ParseCommand.java:1)
   at com.parse.Task$11.run(Task.java:474)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)


   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.continueWith(Task.java:316)
   at com.parse.Task.continueWith(Task.java:327)
   at com.parse.Task$11.run(Task.java:478)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.access$8(Task.java:435)
   at com.parse.Task$6.then(Task.java:309)
   at com.parse.Task$6.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.continueWith(Task.java:316)
   at com.parse.Task.continueWith(Task.java:327)
   at com.parse.Task$11.run(Task.java:478)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$3.run(Task.java:227)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
   at java.lang.Thread.run(Thread.java:1096)
Message longer than Log limit (4000). Message was truncated.
FATAL EXCEPTION: main


java.lang.NullPointerException
   at com.parse.ParseQuery$15.then(ParseQuery.java:746)
   at com.parse.ParseQuery$15.then(ParseQuery.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.access$8(Task.java:435)
   at com.parse.Task$6.then(Task.java:309)
   at com.parse.Task$6.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.ParseCommand$4.then(ParseCommand.java:357)
   at com.parse.ParseCommand$4.then(ParseCommand.java:1)
   at com.parse.Task$11.run(Task.java:474)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.continueWith(Task.java:316)
   at com.parse.Task.continueWith(Task.java:327)
   at com.parse.Task$11.run(Task.java:478)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.access$8(Task.java:435)
   at com.parse.Task$6.then(Task.java:309)
   at com.parse.Task$6.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$11$1.then(Task.java:483)
   at com.parse.Task$11$1.then(Task.java:1)
   at com.parse.Task$10.run(Task.java:442)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeImmediately(Task.java:439)
   at com.parse.Task.continueWith(Task.java:316)
   at com.parse.Task.continueWith(Task.java:327)
   at com.parse.Task$11.run(Task.java:478)
   at com.parse.Task$1.execute(Task.java:67)
   at com.parse.Task.completeAfterTask(Task.java:471)
   at com.parse.Task.access$9(Task.java:467)
   at com.parse.Task$7.then(Task.java:343)
   at com.parse.Task$7.then(Task.java:1)
   at com.parse.Task.runContinuations(Task.java:502)
   at com.parse.Task.access$5(Task.java:498)
   at com.parse.Task$TaskCompletionSource.trySetError(Task.java:573)
   at com.parse.Task$TaskCompletionSource.setError(Task.java:600)
   at com.parse.Task$3.run(Task.java:227)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:114)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:229)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
   at java.lang.Thread.run(Thread.java:1096)


  Force finishing activity boten.KsHof/.main


Activity pause timeout for HistoryRecord{4505dac8 boten.KsHof/.main}


Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44eecea8


Sending signal. PID: 762 SIG: 9


Process boten.KsHof (pid 762) has died.


WIN DEATH: Window{450a8150 boten.KsHof/boten.KsHof.main paused=false}


WIN DEATH: Window{450570e8 boten.KsHof/boten.KsHof.main paused=false}


Activity destroy timeout for HistoryRecord{4505dac8 boten.KsHof/.main}
 

LucaMs

Expert
Licensed User
Longtime User
If I could sell my unique app (for the moment) to 10,000 people (not even worth planning to sell less, given the low prices at which we are forced to sell them), I imagine that, on average, each would exceed the 100 queries per month, for a total of 1,000,000 queries / month.

I think that move to the second level, the negligible cost of $ 199 per month, becomes immediately necessary.

But yeah, so then all sell their app to less than 3 € or for free.

This seems like more and more a world of self-harming!

(sorry, the translation is not so good, but... that's it )
 

pesquera

Active Member
Licensed User
Longtime User
Hi, it's a very nice job! very powerfull

I have an issue with the Channel.. trying to assign a different one for each device

Using in this way I have not errors:
Parse.Subscribe("Channel2", Notification)

But, assigning the channel parameter with a string variable or calling a function, the app crashs:
Dim ph As Phone
Parse.Subscribe(ph.GetSettings("android_id"), Notification)



I have updated from the last Parse sdk v1.3.9 to ParseNative.jar (library folder)

Thanks for your help



The error is:


ParseApplication.onCreate xml Id = 2130903040


data null
data1 PijJiGmTjWVCTkm3kO22Z3OFss1S4jVjdzdEPQ6w
data2 cAly6BMALzdPheTWmVdU9p73WN8M5xUJZ7mUF5vP
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 309)
java.lang.IllegalArgumentException: invalid channel name: 50c0e03433f755d0
at com.parse.ParsePushRouter.addChannelRoute(ParsePushRouter.java:410)
at com.parse.PushService.subscribe(PushService.java:193)
at com.parse.PushService.subscribe(PushService.java:162)
at anywheresoftware.b4a.objects.ParseObjectWrapper$ParseWrapper.Subscribe(ParseObjectWrapper.java:493)
at parse.test.main._activity_create(main.java:309)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at parse.test.main.afterFirstLayout(main.java:98)
at parse.test.main.access$100(main.java:16)
at parse.test.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
java.lang.IllegalArgumentException: invalid channel name: 50c0e03433f755d0
 

pesquera

Active Member
Licensed User
Longtime User
try & error

this solved the issue:
Parse.Subscribe("x" & ph.GetSettings("android_id"), Notification)

just adding a letter as first character

any ideas? (killed to me)
 

ckapucu

Member
Licensed User
Longtime User
I could send push messages to the devices with my applications installed, but is it possible to send push messages even when the application not running. I tried it, after stopping the application with a task manager, sent some messages but nothing happened! What is wrong with it?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…