Tip:
Highlight text to annotate it
X
Hi. I’m Cheng from the bada team at Samsung. Welcome to a series of videos that introduce
BuddyFix, our Open Source Location Based Social Networking Application.
BuddyFix is now open source. We’ve designed these videos to help you use the BuddyFix
code to build your own exciting social application for bada.
In the first video in this series we introduced the Social::Services namespace and explained
the features provided by the bada server: profiles, privacy, the Buddy Service and messaging.
We also introduced the SnsGateway which is used to communicate with 3rd party social
networks such as Facebook and Twitter. In this video we’ll take a detailed look
at the BuddyFix code and see how a real world application implements social networking features
in bada. Let’s start with a look at profiles and
privacy. We’ll introduce you to how use profiles in BuddyFix and how you can control
who sees you profile information. The first time you launch BuddyFix, it will
ask you to enter some details for your profile. Such as first name, last name, display name,
user icon and gender. For any social networking application, the
user profile is always important for presenting yourself and finding others.
Your profile is stored on the bada server and is used by others to search for you and
add you as a Buddy. In BuddyFix, profiles are managed by our ProfileManager
class, defined in ProfileManager.h: The BuddyFix ProfileManager is a high level
wrapper class of ProfileService and PrivacyManager which allow the users to set their profile
information and privacy levels from one single class.
This class also derives from IProfileServiceListener and so gets to handle profile related events.
The implementation for the ProfileManager class is found in the ProfileManager.cpp file.
The UpdateUserProfiles() method is called whenever the user updates their profile information.
In bada, there are many types of profiles allow developers to use. In BuddyFix, we use
the BasicProfile profile which mainly contains minimal information such as the user’s name
and gender and the ContactProfile, which we use to store their phone number.
Notice that the SetValue() method is used set the specified element of the profile.
The BasicProfile is also used to store the user’s photo, which we’ll explain in more
detail later. The ProfileService class is used to manage
profiles on the bada server. When we update the profile information we then need to call
the UpdateMyProfile() of ProfileService to ensure that the profiles are updated.
The ProfileService class is also used to get the profile information for the currently
logged in user. Our RequestUserProfiles() method calls GetMyProfile() to read the current
user’s profile information. Since we have to communicate with the server
and this is an asynchronous call, the profile information is returned in the IProfileServiceListener::OnMyProfileReceived()callback,
which we implement in our ProfileManager class. In BuddyFix you can set up your profile image
by clicking the profile icon and choosing a picture stored on the device.
However, the bada platform doesn’t provide you the storage for the user icon.
You need to either use a picture from a known URL or upload your own photo to Amazon S3
workspace or other online photo storage site. Then you set the remote URL to the basic profile
BP_PID_PHOTO element. The BuddyFix UI only allows you to manipulate
the user’s basic profile information. If you want to have more control over the
user’s other types of profile, such as contact profile or social profile, you need to implement
your own UI to do that. Privacy is a major concern for the users of
social networking applications. BuddyFix gives you the option of specifying
who can see your profile information and which information they can see.
Of course, the more information your friends provide, the easier it is for you to find
them. So your application needs to find a balance
between privacy and how easy it is for you to be found by your buddies.
The first time you launch BuddyFix, the user profile is set up so that everyone with a
Samsung account can view and search for it. However, you can use the BuddyFix settings
to set it to closed, so that it will not be included in a search.
We call the BuddyFix method SetUserInfoPrivacy () to change the user’s privacy settings.
The SetProfileExposureLevel () method of PrivacyManager is used to control who can see the currently
logged in user’s profile information. If the privacy level is viewable or searchable
then the BasicProfile is open, but the rest of the profile information is set individually.
By including Phone Number in the search criteria, we can achieve more accurate search results.
But as I mentioned earlier, it is a trade off between privacy and user experience.
BuddyFix uses the BuddySearchEngine class to help you search for your buddies in a more
accurate way. Let’s take a look at how it works.
In any social application, making it easier for the user to find and add new friends in
the trickiest part for the developer. Research has indicated that for a social application
to be successful, the user needs to be able to quickly and easily find and add 5 friends
in the newly installed application. If they can’t find their friends, then they
are very likely to stop using the application. In BuddyFix, we manage the searching in a
way that makes it easier to find your friends. We have a class called BuddySearchEngine to
get the best matched user from the bada Server. The way it works is that it combines multiple
search results into one list and give you the most matched results at the top.
The user can choose to search for Buddies on the bada server by matching contact information
from their phone book, or entering information in the search field.
The BuddySearchEngine class will search for profiles on the bada server which match any
of: email address, phone number or name. Successive calls are made to the profile manager
method, such as SearchProfilesByEmail, SearchProfilesByName and SearchProfilesByPhoneNumber and SearchProfilesByLoginId
and the results are combined, with any duplicates identified by the contact’s userID.
This search strategy lets BuddyFix identify the most possible potential Buddies.
A buddy request is sent out automatically in BuddyFix once you add the selected buddies
from the list. Once the Buddy request is sent, you can send
messages to this new Buddy, but if they don’t accept the Buddy request, you won’t be able
to share your location information with each other.
In this video we showed you how BuddyFix uses profiles, how the PrivacyManager is used to
control who can see your profile information and how BuddyFix allows you to search for
buddies. Thanks for watching. In the next video we
are going to show you how to send a message to your buddies.