Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posté(e)

bonjour,
je viens de crée un widget(non fonctionnel) cad juste l'interface graphique mais il n'apparait pas dans l'émulteur,sachant qu'il ny a aucun bug. donc si vous pouviez me dire pourquoi... icon_sad.gif et je soupçonne la faute au niveau de l'androidManifest

MainActivity

package com.example.widget;


import android.appwidget.AppWidgetProvider;

public class MainActivity extends AppWidgetProvider{
}


FragmentMain

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:background="@drawable/heyehy"
>

<TextView
android:id="@+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="80sp"
android:textStyle="bold"
android:textColor="#FF0000"

/>

<ImageButton
android:id="@+id/boutonplus"
android:layout_width="92dp"
android:layout_height="wrap_content"
android:layout_above="@+id/boutonClear"
android:layout_alignParentTop="true"
android:layout_marginLeft="28dp"
android:layout_toRightOf="@+id/number"
android:src="@drawable/beer128" />


<Button
android:id="@+id/boutonmoin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/number"
android:layout_marginTop="16dp"
android:text="-" 
/>

<Button
android:id="@+id/boutonClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/boutonmoin"
android:layout_alignTop="@id/boutonmoin"
android:text="clear"
android:layout_alignRight="@id/boutonplus"
/>

</RelativeLayout>

AndroidManifest


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.widget"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<receiver
android:name="com.example.widget.MainActivity"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<action android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/my_widget_provider" />
</receiver>
</application>

</manifest>


MyWidgetProvider



<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="160dip"
android:minHeight="80dip"
android:updatePeriodMillis="1000000"
android:initialLayout="@layout/fragment_main"


/>

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.