android-widget

Android: Align LinearLayout center for all screen sizes

蹲街弑〆低调 提交于 2020-01-13 09:37:08
问题 I want to design a layout for my login screen, I tried the following codes. Using some hardcoded values I got my center green color layout center for some screen sizes. I know using hardcoded values wont work on different screen sizes. I tried numerous stuffs on SO. Please provide me the best way <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background

Insert 3 images dynamically to horizontal scrollview or Viewpager

我怕爱的太早我们不能终老 提交于 2020-01-13 05:35:19
问题 There is an image shown below for what I am looking for. Currently I am using view pager & circle indicator. In view page it is showing only a single image. I want in one viewpager three images as shown in pic. When I slide that page, again three different images loaded form server with text below. How to do this? Any idea regarding this or any other way to achieve this? My code is shown below. I add some xml layout here: homespizzaview.xml <LinearLayout android:id="@+id/linearLayoutbutton"

Create, store and inflate custom layout in runtime

人盡茶涼 提交于 2020-01-12 05:31:07
问题 I'm trying to find a solution for the following problem. The application I work on requires a possibility for user to produce custom UI (layout of simple widgets) via custom UI builder. So, user may stack widgets (images, mostly. But TextViews and EditText, as well) on canvas, move them around, etc. UI have to be stored in a database for future use. So, there should be some mechanism for loading and inflating of this UI. This is the main problem. My first idea was to rely on standard Android

Android Widget Bitmap Sizes

半城伤御伤魂 提交于 2020-01-11 19:54:33
问题 Hallo, I am writing a widget, but am unsure what size bitmap to use as a background for each screen resolution/density. According to the Android Developer App Widgets tutorial: To find your minimum width and height in density-independent pixels (dp), use this formula: (number of cells * 74) - 2 Following this formula, you should use 72 dp for a height of one cell, 294 dp and for a width of four cells So if my widget is 72dp x 294dp, what size bitmaps do I need for my ldpi, mdpi and hdpi

Android Widget Bitmap Sizes

為{幸葍}努か 提交于 2020-01-11 19:53:02
问题 Hallo, I am writing a widget, but am unsure what size bitmap to use as a background for each screen resolution/density. According to the Android Developer App Widgets tutorial: To find your minimum width and height in density-independent pixels (dp), use this formula: (number of cells * 74) - 2 Following this formula, you should use 72 dp for a height of one cell, 294 dp and for a width of four cells So if my widget is 72dp x 294dp, what size bitmaps do I need for my ldpi, mdpi and hdpi

Update TextView text size on AppWidget

北城以北 提交于 2020-01-11 11:33:13
问题 I can not figure this out, I've been struggling with it for days now, and I'm so tired of it.. I'm changing the text size of a TextView on an AppWidget with a Spinner from a Configuration Activity, and I can't get it to update correctly. It does not update the first time I tell it to, but it does update the second and third and every time afterwards. I'll really really appreciate if someone would take a look at my code Thank you very much Config class: public class WidgetConfig extends

Minimal Android widget, APPWIDGET_DELETED and APPWIDGET_DISABLED intents never being received

时光总嘲笑我的痴心妄想 提交于 2020-01-11 09:51:08
问题 I have a problem very similar to those that have been asked before, but not exactly the same. References: 1, 2, 3, 4 I have coded up a minimal Android widget, and the APPWIDGET_DELETED and APPWIDGET_DISABLED are never being received. In references 1 and 2 above, the solution presented is to implement onReceive and explicitly look for those intents. However, I inserted a log call in onReceive , and can confirm that neither of those intents are ever appearing, though APPWIDGET_UPDATE and

R.styleable can not be resolved, why?

与世无争的帅哥 提交于 2020-01-09 07:42:26
问题 I have a resources.xml file located under direcotry values/ , That's /values/resources.xml <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="TheMissingTabWidget"> <attr name="android:divider" /> </declare-styleable> </resources> In my java code, when I try to access this resource by R.styleable.TheMissingTabWidget , eclipse complain that styleable cannot be resolved or is not a field . Why? Why I can not access this resource? (I am using android 2.1-updated). 回答1:

How to get all apps installed on android phone

你离开我真会死。 提交于 2020-01-09 07:11:07
问题 This is the code that i have at the moment but i still can't get a list of all the apps on the phone. Does anyone see what i am doing wrong? public class GetAppList extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); try { List<PackageInfo> appListInfo1 = this.getPackageManager() .getInstalledPackages(0); JSONArray ja = new JSONArray(); try {

How to get all apps installed on android phone

落爺英雄遲暮 提交于 2020-01-09 07:10:08
问题 This is the code that i have at the moment but i still can't get a list of all the apps on the phone. Does anyone see what i am doing wrong? public class GetAppList extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); try { List<PackageInfo> appListInfo1 = this.getPackageManager() .getInstalledPackages(0); JSONArray ja = new JSONArray(); try {