B4A Library Scringo for Basic4Android is live!

[Lib] Scringo for Basic4Android is live!

Hi all, We just released Scringo's support for Basic4Android.

For those of you who don't know Scringo, it's a Social Sidebar with lots of stuff you can add there. Just a few features:
1. Chat - your users can talk to each other
2. Activity Feed - your users can see what interesting things other people are doing in your app
3. Like button - you can add it and let users see what other people like in your app
4. Feedback - let your users send you feedback about your app
5. Rate us - let them rate the app
6. Push notifications - send push notifications and system messages to your users
7. Chat room - start a topic and let your users say express themselves (managed and moderated using the dev zone)
8. Custom buttons - don't know where to place a button - place it on the sidebar and get a notification once it is clicked

And lotsa other stuff. It's all configurable from our dev zone, no need for an upgrade to add or remove features once you integrated the SDK.

And of course, it's all free.

Here's a demo project: http://www.b4x.com/android/files/ScringoB4AExample.zip

Attached are the library files (jar and xml). Place them in your libs folder and include them in your b4a project.

Then you'll need to follow these steps:
1. Register in scringo.com, get an App ID, and download the SDK. (use this link instead of the one in the dev zone, customized for B4A devs: https://dev.scringo.com/downloads/scringo-android-2.2.2-b4a.zip)
2. Open the zip and place the jars from the libs folder in your b4a libs folder (should be the same folder as above).
3. Add the contents of the ScringoManifest.txt from the zip using the B4A Manifest Editor (Project -> Manifest Editor -> Paste this: )
AddApplicationText(
<Contents of ScringoManifest.txt>
)
4. Merge the res folder from the ScringoResources with your Objects/res, and set them all to read-only (In a Windows Browser, Right click the folder -> Read Only, no need to do it one by one)
5. add the scringo.properties from the zip to the Files folder and add it to the B4A project in the Files tab, edit the file and add your Scringo app ID in the scringo.app.id property
6. Add some (or all) of this code to your code (assuming you have a MainLayout with Button1 in it):
B4X:
Sub Globals
   Dim myScringo As Scringo
   
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("MainLayout")
   myScringo.Initialize
End Sub

Sub Activity_Resume
   myScringo.onStart
End Sub

Sub Activity_Pause (UserClosed As Boolean)
   myScringo.onStop
End Sub

Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
   If myScringo.onBackPressed Then
      Return True
   End If
End If
Return False

End Sub

Sub Button1_Click
   myScringo.openMenu
End Sub

That's it, you're good to go. Tell us how it went!

For any questions, you can drop me a line at [email protected]

The Scringo Team
 

Attachments

  • ScringoB4A.zip
    3.3 KB · Views: 431
Last edited:

capisx

Member
Licensed User
Longtime User
1. maybe the Facebook app (in the FB website app settings) shows you're in sandbox mode?
sandbox mode: OFF

2. or maybe the debug.keystore isn't really the one you're using (it's in c:\Users\<Your_User>\.android\debug.keystore, Erel, correct me if I'm wrong regarding B4A)
i've use the one that available in B4A directory. I don't have the debug.keystore on c:\Users\<My_User>\.android\ although the directory is exist.

:confused: If the hashkey i create was wrong, why this problem doesn't occurred on my device without official facebook app? is this relating to B4A?
 

socialnetis

Active Member
Licensed User
Longtime User
sandbox mode: OFF


i've use the one that available in B4A directory. I don't have the debug.keystore on c:\Users\<My_User>\.android\ although the directory is exist.

:confused: If the hashkey i create was wrong, why this problem doesn't occurred on my device without official facebook app? is this relating to B4A?

How are you generating the hash keys? Remember that if you have changed the private signing key in the B4A IDE, then you have to reference to that keystore.
The alias is "b4a", and the password is the one you used to create the key
 

capisx

Member
Licensed User
Longtime User
finally, after a full day of looking for the cause of the facebook login problem that i encountered i've found what is wrong.
The problem occurred because i was using openssl-0.9.8k_X64 to generate hash key, i've got the wrong hash key from that version. After using openssl-0.9.8d_X64 facebook login works fine now.

For newbie like me that doesn't know how to generate facebook Hash Key, check this LINK. (don't use openssl-0.9.8k)
 

nrasool

Member
Licensed User
Longtime User
Hi there

I have updated to the latest which is 2.20 on the website, now when I go, I see 2 new button, see attached. As I am developing for 320x480, it seems kinda cramp. Also the sign up and log in is not working

Any way of making these button disappear?

Kind Regards
 

Attachments

  • buildroid_vbox86p_4.png
    buildroid_vbox86p_4.png
    27.8 KB · Views: 365

scringo

Member
Licensed User
Longtime User
Hi there

I have updated to the latest which is 2.20 on the website, now when I go, I see 2 new button, see attached. As I am developing for 320x480, it seems kinda cramp. Also the sign up and log in is not working

Any way of making these button disappear?

Kind Regards

Wow, how did that happen?! send me your project to [email protected] and I'll take a look
Ofer
 

nrasool

Member
Licensed User
Longtime User
Hi Ofer,

Sent you an email, I have managed to replicate it on your example project file and have sent you that with a screenshot :)

Many thanks

Kind Regards
Nadeem R
 

nrasool

Member
Licensed User
Longtime User
This is fixed, the issue is that I didn't update the scringo.jar file in the additional library, I only updated the res files for 2.20

Sorry and thanks Ofer :)
 

Penguin

Member
Licensed User
Longtime User
I can't wait for the next Update. Scringo is such a cool feature

:sign0098:
 

lorebarita

Member
Licensed User
Longtime User
google_play_services lib

Scringo works well for me but Radar does not work and causes the whole application to fail. Where do i place the google_play_services in the sdk that I downloaded

Speficically this is the error am getting once i click the Radar

java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
 
Last edited:

abay1968

Member
Licensed User
Longtime User
Hi,

I have tried the sample project and it seams to work fine except login to twitter was failed.

The scenario is like this;

After filled in username & password and then i push the 'Authorise App' button. After the username & password has been verified (looks success) but the page was redirecting back to login page and the twitter logged in status revert to unlogged.

Here is my manifest.xml content

'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddApplicationText(
<receiver android:name="com.scringo.push.ScringoGCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="$PACKAGE$"/>
</intent-filter>
</receiver>
<service android:name="com.scringo.service.ScringoScreenBroadcastReceiver"/>
<service android:name="com.scringo.push.ScringoGCMIntentService"/>
<service android:name="com.scringo.service.ScringoService" />

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<permission android:name="$PACKAGE$.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="$PACKAGE$.permission.C2D_MESSAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

<activity android:name="anywheresoftware.b4a.objects.preferenceactivity"/>

<activity android:name="com.scringo.features.radar.ScringoRadarActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.feed.ScringoFeedActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.profile.ScringoProfileActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.profile.ScringoFollowersActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.inbox.ScringoInboxActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.inbox.ScringoChatActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.invite.ScringoInviteActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.twitter.ScringoTwitterActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.feedback.ScringoFeedbackActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.invite.ScringoFindFriendsActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.inbox.ScringoSendToActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.profile.ScringoProfileBridge" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.profile.ScringoProfileEditBio" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.feedback.ScringoFeedbackRootActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.inbox.ScringoSystemMessageActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.invite.ScringoFindFriendsRootActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.invite.ScringoSuggestionsActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.apps.ScringoAppDiscoveryActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.chatroom.ScringoChatroomActivity" android:configChanges="orientation|keyboardHidden"/>
<activity android:name="com.scringo.features.chatroom.ScringoTopicActivity" android:configChanges="orientation|keyboardHidden"/>

<activity android:name="com.scringo.features.profile.ScringoSignUpRootActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoSignUpActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoLoginRootActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoLoginActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoSignUpSettingsActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoForgotPasswordActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoChangePasswordActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.quiz.ScringoQuizzesActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.quiz.ScringoQuizActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.quiz.ScringoQuizIntroActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.quiz.ScringoQuizStoreActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.menu.ScringoMenuActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.profile.ScringoMyProfileActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.scores.ScringoScoresActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.scringo.features.quiz.ScringoSuggestQuestionActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>
<activity android:name="com.facebook.LoginActivity" android:configChanges="orientation|keyboardHidden|screenSize"/>

<uses-library android:name="com.google.android.maps" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="My_API_Key"/>
<permission android:name="$PACKAGE$.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="$PACKAGE$.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

)
 

Attachments

  • scringo_log_1.png
    scringo_log_1.png
    50.8 KB · Views: 221
  • scringo_log_2.png
    scringo_log_2.png
    15.8 KB · Views: 228
  • scringo_screen_1.png
    scringo_screen_1.png
    90.7 KB · Views: 228
  • scringo_screen_2.png
    scringo_screen_2.png
    71.4 KB · Views: 229
  • scringo_screen_3.png
    scringo_screen_3.png
    69.8 KB · Views: 223

scringo

Member
Licensed User
Longtime User
Did you set the Twitter credentials in the scringo.properties? if so, did you set the callback URL in the Twitter developer zone?
 

socialnetis

Active Member
Licensed User
Longtime User
Hi Everyone, I have made a new wrapper for the lastest Scringo Version (2.3.5).
What's new in this version:
- Bug fixes- Added ScringoCommentButton and ad-hoc chat rooms
- Added the ability to reply to System messages
- In-app billing improvements- Quiz and Leaderboard- Facebook SDK 3.0 integration

What's in this wrapper:
- Everything from version 2.2.2
- The "Like" Button (you have to add it by code, and then call the method "setLike")
- The "Comment" Button
- The Activation Button
- The Ribbon Button
- Event raised when a feed post is clicked
- Event raised when a custom Menu item has been added from the DashBoard

I have attached a .zip file containing:
- res folder (this contains the Scringo and Facebook resources)
- libs folder (dependencies of the Scringo sdk)
- scringo.2.3.5.jar (the real Scringo sdk)
- ScringoB4A.2.3.5.jar and ScringoB4A.2.3.5.xml (the wrapper of Scringo for B4A).
- scringo.properties
- Manifest.xml (what needs to be added to the manifest)

How to use it:
1. Register in scringo.com, get an App ID
2. Open the rar attached in this post and place the jars from the libs folder in your B4A AddLibraries folder.3. Also place scringo.2.3.5.jar ScringoB4A.2.3.5.jar and ScringoB4A.2.3.5.xml in your B4A AddLibraries folder.3. Add the contents of the Manifest.txt from the rar using the B4A Manifest Editor (Project -> Manifest Editor -> Paste this: )
AddApplicationText(
<Contents of Manifest.txt>
)4. Merge the res folder from .rar with your Objects/res, and set them all to read-only (In a Windows Browser, Right click the folder -> Read Only, no need to do it one by one)
5. add the scringo.properties from the zip to the Files folder and add it to the B4A project in the Files tab, edit the file and add your Scringo app ID in the scringo.app.id property

And that's it, you can start using Scringo.
- For Facebook login, you need to put your Facebook App Id in the res/values/scringo_strings.xml in this line:
<string name="replace_this_facebook_app_id">xxxxxxxxxxxxxxxx</string>
(replace the xxxxxxxxxxxxxxxx with your actual fb id)
- For twitter login, you just need to follow the steps from the Scringo Developers Zone (https://dev.scringo.com/resources.php?resource=guides&sub=Android)

Here are the classes and methods:
ScringoB4A.2.3.5
Version:
1.1
  • Scringo
    Events:
    • OnMenuItemClicked (actionId as String As )
    • OnPostItemClicked (actionId as String As )
    Fields:
    • COMMENT_IMAGE As ScringoCommentObjectType
    • COMMENT_VIDEO As ScringoCommentObjectType
    • ICON_PERSON As ScringoIcon
    • ICON_THREE_DOTS As ScringoIcon
    • ICON_THREE_DOTS_CIRCLE As ScringoIcon
    • ICON_THREE_LINES As ScringoIcon
    • LIKE_COMMENT As ScringoLikeObjectType
    • LIKE_IMAGE As ScringoLikeObjectType
    • LIKE_NONE As ScringoLikeObjectType
    • LIKE_OTHER As ScringoLikeObjectType
    • LIKE_POST As ScringoLikeObjectType
    • LIKE_TOPIC As ScringoLikeObjectType
    • LIKE_VIDEO As ScringoLikeObjectType
    Methods:
    • Initialize (EventName As String)
    • OnStart
    • OnStop
    • PopInAdsEnabled (popInAds As Boolean)
    • SendFeed (message As String, descriptionImageUrl As String, descriptionText As String, descriptionSubText As String, actionVerb As String, actionId As String)
    • TestMode (test As Boolean)
    • closeMenu
    • isLoggedIn As Boolean
    • onBackPressed As Boolean
    • openActivityFeed
    • openChatRooms
    • openFeedback
    • openFindFriends
    • openInbox
    • openLeaderboard
    • openLogin
    • openMenu
    • openMyProfile
    • openQuiz
    • openRadar
    • openSignUp
    • pauseSwipe
    • resumeSwipe
    • setTwitterCredentials (twitterAppToken As String, twitterAppSecret As String)
    • setScore (Score As Int,LevelAs String)
    • showPopInAdNow
    Permissions:
    • android.permission.ACCESS_NETWORK_STATE
    • android.permission.INTERNET
    • android.permission.WRITE_EXTERNAL_STORAGE
    Properties:
    • GoogleAppPublicKey As String [write only]
    • Icon As ScringoIcon [write only]
    • UserId As String [read only]
    • UserPhotoUrl As String [read only]
  • ScringoCommentButton
    Methods:
    • BringToFront
    • Initialize
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • setComment (s As SNScringo, objectId As String, objectType As ScringoCommentObjectType, title As String)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
  • ScringoLikeButton
    Methods:
    • BringToFront
    • Initialize
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • setLike (s As SNScringo, objectId As String, objectType As ScringoLikeObjectType, objectDesc As String)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int

The Zip is too big for this forum, so I uploaded it to my Dropbox account, here is the link:
https://www.dropbox.com/s/fq1i9us3xzy6rtx/ScringoB4A.2.3.5.zip

Enjoy!
 
Last edited:

scringo

Member
Licensed User
Longtime User
Well, I'm speechless! SocialNetis, that's simply incredible. Many thanks for this!
Ofer
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
SocialNetis,

Thanks for your work on this. I am experiencing a few problems with this. When I try to login with Facebook, I end up with a screening that says "Please wait" with a never ending progress indicator.

Additionally, while your lib can open the Leaderboard, I don't see any way of posting scores to it.

The last thing is something Ofer added to the original lib: pauseSwipe and resumeSwipe. This turns the swipe functionality on and off. I have swiping in some of my games for playing the games. If the user tries to swipe during the game, it opens the Scringo menu and prevents them from playing. The pauseSwipe function allowed me to turn that off while a game is being played.

Best regards,
Jack
 

socialnetis

Active Member
Licensed User
Longtime User
Hi Jack,
Thanks for your work on this. I am experiencing a few problems with this. When I try to login with Facebook, I end up with a screening that says "Please wait" with a never ending progress indicator.
I had the same issue once, and it was because I tested it with an app that had an old hash key set in Facebook. Once I changed, the login was succesful.
So, make sure that the hash key set in the Facebook App, is the same one that you are using in your app (maybe you are using the debug key in fb app, and the release key in B4A).

Additionally, while your lib can open the Leaderboard, I don't see any way of posting scores to it.

The last thing is something Ofer added to the original lib: pauseSwipe and resumeSwipe. This turns the swipe functionality on and off. I have swiping in some of my games for playing the games. If the user tries to swipe during the game, it opens the Scringo menu and prevents them from playing. The pauseSwipe function allowed me to turn that off while a game is being played.
Added pauseSwipe, resumeSwipe, and setScore to version 1.1, The download link is the same, but its updated now.
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
Thanks for the quick work and response! I used the release key in the app and in facebook. I use the same hash key as I set up for another app, because they use the same signing key. Could this be the problem?
 
Top