AndroidWearable-Samples icon indicating copy to clipboard operation
AndroidWearable-Samples copied to clipboard

FindMyPhone

Open jackygrahamez opened this issue 10 years ago • 2 comments

I tried to run FindMyPhone from Android Studio but there is no activity provided for the Application module. I added an empty MainActivity.

public class MainActivity extends Activity {

}

And created a listing in the mainfest

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

I also notice the mainifest indicates this service is not found android:name="com.example.android.wearable.findphone.SoundAlarmListenerService" > But I do have SoundAlarmListenerService.java in the path.

When I run the Wearable the alarm does not trigger on the phone.

jackygrahamez avatar Feb 15 '15 14:02 jackygrahamez

Hi Jacky, I guess you could start the service after boot complete. Like this Answer, make a application without any activity and a service only.

android-feng avatar Mar 17 '15 03:03 android-feng

Your MainActivity should display the layout and start the service. Then, my phone is well ringing.

public class MainActivity extends Activity {

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); startService(new Intent(this, SoundAlarmListenerService.class)); } }

sperochon avatar Mar 26 '15 18:03 sperochon