The al-Shabab attack on Garissa University in Kenya, the ongoing battle with Boko Haram in Nigeria, and the arrival of ISIL in Libya highlight the expansion of violent groups in Africa.

Alongside military operations, some governments are now attempting to challenge the basic tenets of violent ideology to stem the flow of recruits to these armed groups.

 Al-Shabab in one minute

The Nigerian government has announced the national education curriculum will be altered as part of its "soft" approach to its "counter-terrorism programme".

Uganda has "created several platforms" to "reach out to the public, highlighting on the dangers of getting involved in radicalism". These include a campaign that employs ex-combatants to warn the public of the dangers of getting involved in "radicalism."

In Kenya, the Media Council published a report critical of journalists' representation of armed groups, while the newly elected Council of Imams and Preachers chairman, Abdala Ateka, urged religious leaders to be vigilant and challenge violent organisations by preaching peace.

But across Africa observers say many imams have lost touch with the youth, government programmes risk being politicised, and research has shown that religion is not always the principal reason for recruitment.

Al-Shabab - changing tactics

On April 2, al-Shabab attackers stormed the Garissa campus in northern Kenya and killed 148 people, mostly students. 

Questions of support for al-Shabab's violent campaign were likely high on the list during a visit to Kenya by US Secretary of State John Kerry, who upon his arrival announced: "Our major message is that fighting terrorism requires a multi-faceted approach."

According to Muhsin Hassan, a conflict adviser at USAID in Kenya, this is a tactic that al-Shabab has adopted as well, and the Somalia-based group has reinvented its message.

Al-Shabab continues to attack civilian targets [Reuters]

Hassan told Al Jazeera al-Shabab shifted its attention to Kenya from its original focus on Somalia, which also indicates a change in recruitment strategy.

When Ethiopia invaded Somalia in 2006, Hassan said, "various Somali groups all over the world were supporting al-Shabab because they were defending the country against foreign invasion. These were folks who didn't necessarily support al-Shabab's ideology".

The turning point came, said Hassan, when an al-Shabab suicide bombing targeting officials killed about 20 young doctors during a medical graduation ceremony in Mogadishu, the Somali capital.

"Somalia needed doctors and after that, many people re-evaluated their support," Hassan said.

Al-Shabab then began crossing into Kenya and kidnapping aid-workers and tourists, and the Kenyan government decided to send the army to intervene in Somalia alongside UN troops.

These military offensives squeezed the rebels, causing them to lose a lot of territory, and al-Shabab turned to guerrilla-warfare tactics with attacks in Kenya and Uganda.

This is when the group began changing its recruitment narratives to co-opt local religious issues, said Hassan.

Out of Somalia

A recent al-Shabab video specified as targets the capital cities of Kenya, Burundi and Uganda saying, "Yesterday the war was in Mogadishu, today it is in Nairobi, Bujumbura and Kampala."

Many young Muslims in Kenya are excluded from employment opportunities and traditional Muslim strongholds such as Eastleigh in Nairobi, the Mombasa coast, and northeastern Kenya suffer the dual effect of insecurity and a lack of development.

Abdulhamid Sakar, executive director of the Kenya Muslim Youth Alliance, runs projects across Kenya to counter al-Shabab recruitment.

He told Al Jazeera that monetary incentives make recruitment more attractive to people in these impoverished parts of the country.

Lately however, Sakar said his organisation has been receiving a lot people returning from Somalia.

"They want to reintegrate back into the community and that has been informed by the false promises they've been given before going to Somalia," he said.

It is a sense of being extremely disregarded, not just by the security services, but also by the government.

Anelli Botha, South African Institute for Security Studies

Sakar said the government has released some funds for youth projects.

"We established an Economic Empowerment Centre to try and exploit some of the potential they've got," he continued.

Why extremism?

Anelli Botha, from the South African Institute for Security Studies, has carried out research both in Somalia and Kenya.

She told Al Jazeera there are many interrelated issues that ultimately play a role into why people participate in "violent extremism".

Botha said in Kenya recruitment goes far beyond economic motives.

"It is a sense of being extremely disregarded not just by the security services but also by the government. And this frustration is what makes people extremely vulnerable," she said.

Kenyans experience corruption every day when the authorities demand bribes for imaginary offences; Kenyan passports are for sale; impunity can be bought for a fee.

According to a 2012 survey by Afrobarometer, 71 percent of Kenyans viewed some or all officials as corrupt.

Botha's research shows that the political circumstances are a key driver of recruitment for "violent extremism".

"People have lost trust, first and foremost in politicians and the political system," she said.

This view is echoed by Freedom Onuoha from the Nigeria National Defence College in Abuja. He said disappointment with governance is a key driver of recruitment for Boko Haram. 

Onuoha told Al Jazeera that for Nigerian youth, "it's a sense of not being sure of their future and so they are confronted with the question of their own identity within the context of governance".

When these extreme ideologies take root, Onuoha said, "it begins to give people a sense of hope or an explanation for their situation and why they are where they are".

'Ruling class'

But this identity crisis may also be a generation gap.

Onuoha said in Nigeria, many young people believe that their elders have mismanaged opportunities for a better future.

"Religious leaders don't denounce the mismanagement and so they see them as part and parcel of the ruling class," he said.

Kenyan troops are fighting Somalia-based al-Shabab [EPA]

In Kenya the security services have repeatedly launched mass round-ups that use ethnic or religious profiling to target and abuse particular groups.

Al-Shabab plays on this in their videos emphasising that Muslims or Somalis are bullied and mistreated.

But Botha is emphatic saying, "You cannot profile - that is simply impossible".

Identity, said Botha, is an important driver of violent extremism.

"People have no sense of national identity. There is no pride that we are Kenyans or we are Ugandan. People first and foremost revert back to ethnic identities or religious identities. And politicians themselves are responsible for fuelling this," she said.

After the Garissa attack, the Kenyan government publicly announced a 10-day amnesty for ex-combatants, a move that was received favourably in the press.

However, analysts argue it needs to be extended and some question the government's commitment to non-military solutions.

"It remains to be seen how they will go about the countering of radicalisation," Hassan said.

Ugandan security services are slowly beginning to engage with civil society organisations and were praised by Muslim youth groups for participating in an open discussion forum.

Many analysts say these are the kind of strategies that are needed.

Botha emphasised there are many different reasons for radicalisation but "in the case of Kenya, 65 percent referred to the way the government responded to them as the final push", she said.

People are often arrested for terrorism-related offences and then released by the courts because there is no evidence.

Botha said the culture within the security services needs to change to one that respects the rule of law and human rights.

"You've got to investigate to arrest, not arrest to investigate," she said.

Source: Al Jazeera