While it was used as an offensivve and derogatory term, it actually origins from the spanish/portugese: "Negro", which in turn gets its routes from the LATIN: NIGER, meaning black.
DO NOT USE THIS TERM IN PUBLIC. You will probably be arrested for racial offences, or have your head kicked in.
"sup ma Homie? how've you been?"
White Man to Black man:
Either black/white close friends:
"ahhh...my white cracka"
White person B: *looks around*
White person A: there none around i checked already
White person B: well in that case, fo shizzle my nizzle niggaaaa.
Black guy "nigga?"
White guy "you know what I mean bro"
Black guy "you mean I'm a nigger"
White guy "Nah man, it ain't like that"
Black guy punches the white guy.
Black guy gets arrested for assault and released without charges because the white guy is accused of using racial slurs (that the Black guy uses everyday in his vocabulary with his "brothers" that he has no idea if he's actually related to).