B4A Library Parse Library – Push Notifications and Cloud Storage

Parse service is shutting down: http://blog.parse.com/announcements/moving-on/

Overview


This library is a rather extensive overhaul of and update to Erels’ original Parse library.

Parse is a company that provides several services for mobile applications and has just been purchased by Facebook so it looks like it should continue to be a stable and reliable service.

You create an account on Parse.com and then create what they call “Applications” which would usually correspond with individual Android applications but don’t have to, so several different Android applications could access a common body of data in a single Parse application. Within Parse applications there are “Classes” of data which look much like a database table and contain ParseObjects which look like an individual row of data in a table.

Capabilities

The two major uses for this library are as follows

1) Providing cloud based data storage and retrieval for data held in the individual Parse Applications in a simple way including querying the stored data. No need to mess with HTTP and networking, it is all done for you in an object oriented fashion.

2) Supporting Push Notifications which can be instigated both from the Parse Web Dashboard of your Parse account and, if you have enabled it in the Dashboard for that Parse application, also from devices running the corresponding Android application. Push Notifications are sent in the context of the individual Parse Applications whose Android applications have registered to receive them but individual devices, or groups of devices, may be selectively targeted by using “Channels”.

Parse offer three levels of service, the first being free as long as you keep within their limits which are one million API Requests per month, one million Push Notifications per month and one Gigabyte of storage use. You can exceed these limits without upgrading to the next paid plan, which is presently 199 US dollars per month if you register a credit card. You can exceed these limits and be charged 7 US cents per one thousand excess API Requests, 20 UC cents per one thousand Pushes and 20 US cents per one Gigabyte of excess storage. There is information on your usage of all three available in your Parse Dashboard.

An API Request is a single network operation which are the ones that raise Basic4android events from the library.

The definition of the number of Pushes is “The total number of push notifications queued for delivery to a client device”. I may be being stupid but that seems ambiguous to me and I don’t understand whether that means that the total number of Push Notifications counts as each single message sent to lots of devices or as the total number of devices to which a single message is sent. I suspect the latter. If anyone knows definitively than please post and I will amend this paragraph.

The amount of storage used is obvious and needs no explanation.

Please read the Parse Android Guide, in the Parse.com Documentation section of their web site, for more information about how to use this library. The Parse Android API document might also be useful occasionally. The mapping of this library objects methods to those of the Java API are usually obvious.

All the operations which need to access the Parse online service are done asynchronously and raise events when complete whose parameters include a Success indication. If an error occurs Success will be False and a ParseException with a message describing the error will be placed in LastException. If necessary this should be processed in the event code as there is a possibility that a further error could occur in another asynchronous call that would overwrite the existing LastException.

Note that these asynchronous operations do not necessarily complete in the order in which they are invoked. To deal with this possibility a TaskID parameter is provided in each call that can be used, if required, to identify which of several possible method calls has just completed.

Installation instructions

In order to use this library you should sign up to Parse.com, go to your Dashboard and create a new Parse application called whatever you feel like calling it. You will need two keys, Application Id and Client Key, which you will find under the Settings for your application. Both are required and need to be copied to the appropriate Process Global variables in the demo.

You also need to download the Parse Android SDK from the Downloads section of the Parse.com web site. Inside the zip file you will find a file named Parse-1.2.4.jar or similar. Copy this to your Additional Libraries folder and rename it ParseNative.jar. Also put Parse.jar and Parse.xml from the demo archive in your Additional Libraries folder.

As detailed in the help for Parse. EnableNotifications in order for your application to receive Push Notifications you need to add the following to the Manifest Editor in your project.
B4X:
SetApplicationAttribute(android:name,"anywheresoftware.b4a.objects.ParseObjectWrapper$ParseApplication")

AddApplicationText(<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
  <intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
    <action android:name="android.intent.action.USER_PRESENT" />
  </intent-filter>
</receiver>)

Version 1.1 of this library specified the Parse keys in a Parse.Initialize method. This method no longer exists in version 1.2 and later. This is because it it was called from within an Activity, but if Android killed your process and then tried to restart the Parse Service this failed because the service started without the activity being created and so was not initialised correctly. Initialisation now occurs on Application creation and requires the library Application class name to be registered in the manifest and the Parse keys to be specified as an xml resource. When the application is loaded you will see the values in the xml file echoed to the filtered logs.

You also need to place a file called res.xml in your project Objects/res/xml folder and make it read-only. The xml folder does not exist in the project archive but will be created at your first compile. The contents of res.xml should specify your Parse keys as follows
B4X:
<!--?xml version="1.0" encoding="utf-8"?-->
<data>
   <data1 value="YourParseApplicationAppID" />
   <data2 value="YourParseApplicationClientKey" />
</data>

The demo project is already set up to receive push notifications. Try sending one from your Parse Application using the Parse Dashboard.

Run the demo and have a play.

Issues

I have found that using IE10 to send a Push from the Parse Dashboard usually causes the Push to be sent twice, you will see this in the Dashboard list of pushes sent and also at the device and of course they both count towards your free total. Chrome appears to work correctly and sends only one. The work-around is obvious.

The Parse library starts a service called PushService to receive the Pushes and which you can see in Settings -> Apps -> Running -> ParseDemo. Prior to Parse SDK 1.2.4 sometimes this service stopped receiving Pushes and the Process needed to be stopped using a Task Manager and restarted. Parse SDK 1.2.5 should have fixed this.

EDIT:- Version 1.2 now posted. See post #6 for details.

EDIT:- Version 1.3 now posted. See post #13 for details.

EDIT:- Version 1.4 now posted. See post #17 for details.
 

Attachments

  • Parse1.4.zip
    43.2 KB · Views: 1,295
Last edited by a moderator:

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?
 
Top