B4A Library Parse Library – Push Notifications and Cloud Storage

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
I don't receive any error message. I posted the log and the phone show a message that ParseDemo crashed
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
If I use your app, what do I have to change in the AndroidManifest or into folder ParseDemo\Objects\res\xml\...?
 

Douglas Farias

Expert
Licensed User
Longtime User

how to fix this? i dont make any changes on the code
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
I noticed that if I add this line to the manifest, the app crash

B4X:
SetApplicationAttribute(android:name,"anywheresoftware.b4a.objects.ParseObjectWrapper$ParseApplication")

I must modify it?

EDIT

If I delete it, I've got this error:

B4X:
LogCat connected to: 0123456789ABCDEFG
--------- beginning of /dev/log/main
-------- beginning of /dev/log/system
** Activity (main) Create, isFirst = true **
java.lang.RuntimeException: You must call Parse.initialize(context, oauthKey, oauthSecret) before using the Parse library.
    at com.parse.ParseUser.checkApplicationContext(ParseUser.java:1162)
    at com.parse.ParseUser.getCurrentUser(ParseUser.java:946)
    at com.parse.ParseUser.getCurrentSessionToken(ParseUser.java:1004)
    at com.parse.ParseAnalytics.createCommand(ParseAnalytics.java:229)
    at com.parse.ParseAnalytics.trackAppOpenedInBackground(ParseAnalytics.java:49)
    at com.parse.ParseAnalytics.trackAppOpened(ParseAnalytics.java:78)
    at anywheresoftware.b4a.objects.ParseObjectWrapper$ParseWrapper.TrackOpening(ParseObjectWrapper.java:448)
    at b4a.example.parse.main._activity_create(main.java:342)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at b4a.example.parse.main.afterFirstLayout(main.java:98)
    at b4a.example.parse.main.access$100(main.java:16)
    at b4a.example.parse.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:153)
    at android.app.ActivityThread.main(ActivityThread.java:5297)
    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:833)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)
 
Last edited:

stu14t

Active Member
Licensed User
Longtime User

Quentin,

If you were to use the ParseUser object, a special object to deal with users to store your info, there is no need to run a query. After logging in the ParseUser object is always available and you can GET information straight to and from it. The ParseUser object is held in session from login to logout.

Now I know the ParseUser is not currently supported but it is only an extension of the standard Parse Object and you may be able to access the methods involved.
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Still having problem.. Please help
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hmm, just having a bit of difficulty with compiling the parse demo 1.4.

B4X:
Parsing code.                           0.01
Compiling code.                         0.02
   
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.                 0.00
Generating R file.                      0.06
Compiling generated Java code.          Error
B4A line: 81
po.put(\
javac 1.7.0_51
src\b4a\example\parse\main.java:383: error: cannot access ParseFile
_po.Put("File",(Object)(_v7.getObject()));
                                     ^
  class file for com.parse.ParseFile not found
1 error
Picked up _JAVA_OPTIONS:  -Xmx512M

The test file exists, I've copied over the parse jar, both including the native one and renamed it. Checked the manifest and made sure that the keys are in the res.xml file and it's read only.

Did I miss something?
 

derez

Expert
Licensed User
Longtime User
Looks like your class in parse is not called by the name you use in the application.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
oh, you mean the path to this example? I just downloaded and extracted it to my desktop. Where would I need to rename it?
 

derez

Expert
Licensed User
Longtime User
From the instructions in the first post:
If you have done this, you have a parse class and you should initialize parseobjects to this name.
For example, I have a class named Family, so I use this code to perform actions with it:
B4X:
...
Dim Addpo As ParseObject
Addpo.Initialize("Family")
...
 

Attachments

  • parse.png
    66.7 KB · Views: 153

merlin2049er

Well-Known Member
Licensed User
Longtime User
Oh, I see. I need to create the parse app with the same name I use in the b4a app.
 

derez

Expert
Licensed User
Longtime User
Yes, I added a picture showing how it looks on Parse.com
You can create fields and add data items in the parse application directly, and then try to work with it by your b4a application.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Thanks.

What do you do with the other files from the Parse -1.7.1 sdk?

I only copied parse -1.7.1.jar and renamed it to ParseNative.jar
 
Last edited:

merlin2049er

Well-Known Member
Licensed User
Longtime User
lol, I see where I made my mistake. I renamed the file ParseNative.jar.

It was actually ParseNative.jar.jar
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
I downloaded the latest parse.com sdk (v1.8) and I'm using B4A v4.00, it compiles, but crashes on launch.
 

QuentinLindh

Member
Licensed User
Longtime User
Thanks for that, I am trying it out-was busy with other things for a while
-Quentin
 

stu14t

Active Member
Licensed User
Longtime User
Is there any plans to extend the library to provide the full complement of Parse attributes?

I've now been working with Parse for over a year now and have seamlessly integrated it into C# desktop programs and PHP web applications and I'll be honest, my Java and understanding of how to wrap third party libraries is poor.

I'm building a suite of programs for industry and I'd love to be able to connect them all using Parse as the back end database.

The most important aspect I'm missing is the ParseUser object. This would help immensely or if someone could help in showing how to extend the current wrapper.
 

lagore

Active Member
Licensed User
Longtime User
I can get ParseDemo to compile and install but the app crashes as soon as it runs I suspect the problem maybe that the latest API (v1.8) has broken the library, in fact the API changed from v1.7. Does anybody have v1.6 or earlier that I could get to see if that sorts out the problem.
 

derez

Expert
Licensed User
Longtime User
I can get ParseDemo to compile and install but the app crashes as soon as it runs
Have you created your Parse application and inserted your specific codes from there to the demo ?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…