Skip to content
Advertisement

Tag: android

Generate a image with custom text in Android

I’m trying to make an app for create custom cards. I’d like to add some text over a custom background (a jpg image). What is the best way of doing it? I’d need to show the user a preview of the card before send it to the server. Thanks Answer Use below code to achieve your requirement You have to

data from sqlite into ArrayList

i am using code this blog to have a draggable list. This tutorial is using a custom DragNDropAdapter that takes the content as an ArrayList. In my listActivity i query a table with returned column name.It has 11 values inserted. i tried to convert it to ArrayList from String[] with many ways such as : or what i get is

How to print all key and values from HashMap in Android?

I am trying to use HashMap in Android sample project. Now, am doing sample project for learn android. I just store keys and values in HashMap, i want to show the keys and their values in EditView. I followed below code in my sample project. But, first key and value only printing in EditView. In EditView iOS = 100 is

How to kill currently running task in android

I am trying to build a task killer type of app in android. I can show the list of currently running task using ActivityManager but facing problem in killing the task. Here is what i am doing to get the list of currently running task : It worked for me But now as I am trying to kill the task

Printing the enum’s name

I’m using eclipse + Android SDK on Ubuntu. I would like to print the name of a sensor type device, there a a lot of them and I want to do it automatically. If I use a I print the (int) type, but I would like the name of the enum. How could I do that? Answer For enumerations, you

calculate number of weeks in a given year

I would like to get the number of weeks in any given year. Even though 52 is accepted as a generalised worldwide answer, the calendars for 2015, 2020 and 2026 actually have 53 weeks. Is there any way that I can calculate this, or any functions that will help me out? Answer According to the wikipedia article on ISO week

Why do I get “must override a superclass method” with @Override?

The following code generates this error message at the public void onClick line. Multiple markers at this line – implements android.view.View.OnClickListener.onClick – The method onClick(View) of type new View.OnClickListener(){} must override a superclass method I can’t understand why. This code is taken from numerous examples I’ve seen. What can possibly be wrong? Answer Check the project’s properties and verify that

Android Resources Class Memory Usage

I’m making modifications to the Android 4.0 launcher and I have been running into many OutOfMemoryErrors. Since the 4.0.3 update it got much worse (or started, it seems before it was fine, but I never got to test properly) and I have tried many many things to fix it. The error is also in the stock launcher without my modifications.

Advertisement