노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

 

AndroidStudio에서 Smack4.1 사용하기 ( for OpenFire )

 

 

해당 주제를 다루는 참고 사이트는 2개로 나누어져 있으며, Eclipse기준으로 되어 있어서,

업그레이드가 필요하다.

 

http://www.tutorialsface.com/2015/08/building-your-own-android-chat-messenger-app-similar-to-whatsapp-using-xmpp-smack-4-1-api-from-scratch-part-1/

 

http://www.tutorialsface.com/2015/08/building-your-own-android-chat-messenger-app-similar-to-whatsapp-using-xmpp-smack-4-1-api-from-scratch-part-2/

 


 

먼저 Part1에서 AndroidStudio로 해당 프로젝트에 알맞는 설정을 해보자

 



이후 설정은 Part1 의 내용처럼 수정 작업을 진행하면 된다.

 

다만, 댓글에 Fison이라는 아이디의 글 내용을 참조해야 한다.

 

 

for me to run it, i change this:
1) ActionBarActivity is deprecated. 
    So i use AppCompatActivity in Chats.java.
2) public class MainActivity extends AppCompatActivity 
    instead of ActionBarActivity
3) i made a modification in Activity_Main.xml

-----------------------------------------------------


xmlns:android="http://schemas.android.com/apk..." />















i add  ......  and comment some code inside

4) i made a modification in MainActivity
only comment This

/*
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
	@Override
	public void onClick(View view) {
		Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
		.setAction("Action", null).show();
	}
});
*/



Gradle 스크립트에 추가할 부분은 아래 링크를 참조하면 될 것 같다.


https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide


-build.gradle ( Project )

-bulid.gradle ( Module )







StakOverflow.com에 올라온 글도 참조 하면 좋을 것 같다.


http://stackoverflow.com/questions/31274020/integrating-smack-with-android-studio-project-for-chat-application

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,