___  ___    _ _    _  _ _____   _____
 / __|/ _ \  | | |  | || |_ _\ \ / / __|
| (_ | (_) | |_  _| | __ || | \ V /| _|
 \___|\___/    |_|  |_||_|___| \_/ |___|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

GitNaija: Finding developers using Github REST api(UPDATE: Share Developer's profile-link Functionality and Skill-set selection Functionality)

BY: @betheleyo | CREATED: May 25, 2018, 8:30 p.m. | VOTES: 10 | PAYOUT: $30.87 | [ VOTE ]

Github repository: https://github.com/Bethel-Eyo/GitNaija 

 The aim of this Native Android app is to help Developers find and contact other developers on github with specific set of skills in specific regions in Nigeria to enhance one on one software development mentorships, to and building of tech teams. 

History

GitNaija: Finding developers using Github REST api in different regions of Nigeria based on their Skillset

New Update

The share feature was added to make the application more engaging. This feature helps the users of GitNaija to recommend developers by sending them the profile-link of the developers that are experienced enough to mentor upcoming developers that might need help on other platforms. So the user is able to share the link of the professional developer directly from the app to  upcoming developers on other platforms after searching for the developer based on the required skill-set and location.

https://steemitimages.com/DQmV3oA4KwVnqtPqZoWUXLM6gYHD6n8MpGhKSWX3nK2TQTt/videotogif_2018.05.16_16.18.03.gif

This is how it was implemented

Firstly i added the FloatActionButton tag to the  developer_profile_detail.xml file. This fab button helps the user trigger the native android share action functionality

<android.support.design.widget.FloatingActionButton
   android:id="@+id/fab"
   android:layout_width="wrap_content"
   android:layout_height="46dp"
   app:layout_anchor="@id/layout_header"
   app:fabSize="normal"
   android:layout_margin="16dp"
   app:layout_anchorGravity="right|bottom|end"
   android:clickable="true"
   app:elevation="5dp"
   app:srcCompat="@android:drawable/ic_menu_share"/>

Then i instantiated the FAB in my developerProfileDetailActivity.java class and i set an onclicklistener on the FAB (Floating Action Button) so that when it is clicked, it triggers a sharingIntent to enable the user share the developer's profile link to users on other platforms with some other attributes such as the header and body

mFab = (FloatingActionButton) findViewById(R.id.fab);
mFab.setOnClickListener(new View.OnClickListener() {
   @Override
   public void onClick(View v) {
       Intent parsedIntent = new Intent(android.content.Intent.ACTION_SEND);
       parsedIntent.setType("text/plain");
       String parsedUsername = mNaijaDevelopers.getDeveloperUsername();
       String parsedProfileUrl = mNaijaDevelopers.getProfileUrl();
       String theHeader = "A Developer from Uyo, Akwa-ibom State Nigeria.";
       String theBody = "<@" + parsedUsername  + ">" + "," + "<" + parsedProfileUrl + ">";
       parsedIntent.putExtra(android.content.Intent.EXTRA_TEXT, theHeader  + theBody);
       startActivity(Intent.createChooser(parsedIntent, "Share via"));
   }
});

Firstly i created a preferences.xml file in my xml resource folder to serve as the user interface for the preferences and to also provide the SettingsFragment.java class with an array of labels and values which is gotten from the arrays.xml file

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
   xmlns:android="http://schemas.android.com/apk/res/android">

   <PreferenceCategory
       android:title="Select a skill-set">
       <ListPreference
           android:defaultValue="@string/pref_skill_value_jav"
           android:entries="@array/pref_skill_option_labels"
           android:entryValues="@array/pref_skill_option_values"
           android:key="@string/pref_skill_key"
           android:title="@string/pref_skill_label"/>
   </PreferenceCategory>

</PreferenceScreen>

Then i inflated the xml in the onCreatePreferences method of my SettingsFragment.java class, i implemented an OnSharedPreferencesChangeListener in both the Settings fragment and my developerFragment, where i used the new skill-set preference chosen by the user to make a new request based on the selected skill-set

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
   // Add visualizer preferences, defined in the XML file in res->xml->preferences
   addPreferencesFromResource(R.xml.preferences);

   SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
   PreferenceScreen prefScreen = getPreferenceScreen();
   int count = prefScreen.getPreferenceCount();

   // Go through all of the preferences if more than one, and set up their preference summary.
   for (int i = 0; i < count; i++) {
       Preference p = prefScreen.getPreference(i);

       String value = sharedPreferences.getString(p.getKey(), "");
       setPreferenceSummary(p, value);
   }
}

and in my developerFragment.java class, i called the skill-set that has been set by the user this way

// this method helps to configure our sharedPreference
private void setUpSharedPreferences(){
   SharedPreferences sharedPreferences = android.support.v7.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());
   loadSkillsetFromSharedPreferences(sharedPreferences);
   sharedPreferences.registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
   if (key.equals(getString(R.string.pref_skill_key))){
       loadedDevelopers.clear();
       loadSkillsetFromSharedPreferences(sharedPreferences);
   }
}

@Override
public void onResume() {
   super.onResume();
   if (loadedDevelopers.isEmpty()){
       setUpSharedPreferences();
   } else {
       setUpSharedPreferences();
   }
}

// this method helps load the skill-set value from the settingsActivity dynamically
private void loadSkillsetFromSharedPreferences(SharedPreferences sharedPreferences){
   String skillSet = sharedPreferences.getString(getString(R.string.pref_skill_key),
           getString(R.string.pref_skill_value_jav));
   searchParams = "language:"+ skillSet+ " location:uyo";
   String statement = "Showing " + skillSet + " developers in Uyo, AKS, Nigeria";
   contextTxt.setText(statement);
   //Toast.makeText(getContext(), searchParams, Toast.LENGTH_SHORT).show();
   updateDeveloperList(searchParams);
}

Screen-shot of the skill-set functionality

https://cdn.steemitimages.com/DQmW1A2JokLWbf7j1gBSqxyDS1dGoCuZqrowE9eGVwAjX5S/shot.png

Resources

RoadMap

  Some of the updates that will be added to this app are stated below.  

Providing the user with options to pick the skill set of their choice and the region of their choice of Github developers to be displayed.

Searching for developers in the region stated above. 

Providing different themes for the user.

Providing persistent data (offline capabilities).

 Sharing developers’ details to friends on other social media platforms.

Creating a list (team) the user can add selected developers to.

TAGS: [ #utopian-io ] [ #development ] [ #open-source ] [ #gitnaija ] [ #project ]

Replies

@amosbastian | May 25, 2018, 9:02 p.m. | Votes: 0 | [ VOTE ]

Thanks for the contribution.

Hi, please structure your post correctly before submitting it, as it is unreadable in its current state. You can use three ``` above and below code snippets to make it look good, like so

print("Hello, World")

The relevant commit also seems to contain a lot of automatically generated code, so it would be best to push that in a separate commit and link to ones where the work is all done by yourself.

Also, is there a reason you posted it with another account here as well?

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.

Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

@betheleyo | May 25, 2018, 9:15 p.m. | Votes: 0 | [ VOTE ]

thanks @amosbastian.. I have carefully re-structured my code. it was all because of the browser i was using. i was unable to format my post well using the markdown. so i tried using another browser. not knowing my friend had used my opera mini browser to check his steemit account. i thought i was posting in my account. so immediately i found out, i changed it. i have done all you have asked me to do now

@utopian-io | May 26, 2018, 8:35 p.m. | Votes: 0 | [ VOTE ]

Hey @betheleyo
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>