Page 196 - MDP2022-2
P. 196
else if (str.equals("door/keypad OFF"))
{
client.publish("iot/door/keypad", "door/keypad OFF");
}
else if (str.equals("pir ON"))
{
client.publish("iot/pir", "pir ON");
}
else if (str.equals("pir OFF"))
{
client.publish("iot/pir", "pir OFF");
}
else if (str.equals("music ON"))
{
client.publish("iot/music", "music ON");
}
else if (str.equals("pir OFF"))
{
client.publish("iot/music", "music OFF");
}
}
다) 안드로이드
개발언어: JAVA
package com.headthings.mdp_project_2022;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.headthings.mdp_project_2022.TransForm.ZoomOutPageTransformer;
import com.headthings.mdp_project_2022.mainFragment.HomeFragment;
import com.headthings.mdp_project_2022.mainFragment.ListFragment;
import com.headthings.mdp_project_2022.mainFragment.SettingFragment;
import butterknife.BindView;
import butterknife.ButterKnife;