I want to know what kind of users are using my app.
I think I need the device id, the network type, the network provider name and its ip address. is there any framework to do this thing?
When I added the JExcelAPI http://jexcelapi.sourceforge.net/ to the
class path and run my app, I get:
trouble writing output: shouldn't happen
[2009-07-16 14:32:19 - xxx] Conversion to Dalvik format failed with
error 2
any idea?
thanks
Hi Guys,
Basically I'm trying to run 2 threads within the same class at the same time. The code runs but only executes whats in run() and doesnt finish the onCreate method... anyone know why?
public Camera1(){
t = new Thread(this, "My Thread");
t.start();
}
public void run(){
bearing();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new Camera1();
makeview();
tracking();
}
Thanks!
this is the first time for me here, so I hope I'm doing this right :)
My question is the following: how do I draw the sprite from an image on the canvas, so that I don't get the entire (squared) image to show, but only the parts of the image I want (= the sprite). For example, I have an image of a robot on a white background and I only want to see the robot, and not the white background.
I hope someone here can help me with this problem, because it's giving me headaches of not knowing how to do it :P
Is it possible to automatically detect, which certificate was used for signing APK? I'd like to have both debug and release Maps certificates in application and pass valid one to MapView constructor.
With such setup I will not make mistake while releasing application - I'm using debug certificate on emulator and my device, then sign with release one before sending app to Market.
I was thinking about detecting my particular device or whether debugger is connected but it is not perfect. Maybe some file marking need for debug certificate? Is there any better way?
If a user uninstalls an app from his phone, which data is explicitly deleted?
I know that preferences are deleted. What about files on the sd card and about databases created by this app?
If the data on the sd card is not deleted how can I avoid cluttering the users phone if I write larger amounts of data, like images on the sd card?
I have a custom Dialog that contains only a TextView to display some text in my application. The documentation lists that only the b, i, u, tt, big, small, sup, sub, and strike tags are supported. I really need to add some newlines for readability. Do I need to change to a more complicated layout, or is there some way to encode newlines in the resource? I tried adding br tags, but that did not help.
Hi guys,
i've got a problem with pushing files to my nexus one:
It seems to me that there is only a small selection of file types that are accepted by my phone (such like jpg, gif and so on).
I recently tried to push other files to my phone (in my case gpx) and my phone has rejected it automatically...
is there a way to bypass or extent this filter?
Is there also a way to catch those files by a service?
greets,
poeschlorn
HI,
I want to create Login option in my application , so that once a person gets login that device creates token which is saved over server. From next time whenever he/she operates the application, directly goes to next label by checking that token keyvalue pair over server.IT requires login page only when that keyvalue pair is deleted from the server.
Can anyone help me from this.I will be very grateful to you.
Looking for reply.
Regards,
Praween
hi
Is there any way to intercept incomming calls/sms (to block or unblock it) on the basis of mobile numbers which are added to screening list.
Thanks in Advance...
I'm writing game with a large amount of .png pictures. All worked fine. Than I added new activity with WebView and got memory shortage. After that I made some experiment - replace game .png images with ones that just fully filled with some color. As result memory shortage had gone.
But I suppose that Bitmap internally hold each pixel separately so such changes should have no effect. Maybe this because of initial images have alpha channel and my test images have not it?
But actually question is: Will decreasing .png images files sizes make some effect on decreasing usage of VM application heap or not?
This should be simple, but I have tried if statements checking for null values and also ones checking the .length of it:
EditText marketValLow = (EditText) findViewById(R.id.marketValLow);
EditText marketValHigh = (EditText) findViewById(R.id.marketValHigh);
if (marketValLow.getText().length() != 0 && marketValHigh.getText().length() != 0) {
Intent intent = new Intent();
intent.setClass(v.getContext(), CurrentlyOwe.class);
startActivity(intent);
} else {
Toast.makeText(CurrentMarketValue.this, "You need to enter a high AND low.", Toast.LENGTH_SHORT);
}
But it doesn't detect nothing was entered. Any ideas?
Thanks!
hi, all,
when i download large data from website, i got this error information:
I/global (20094): Default buffer size used in BufferedInputStream constructor.
It would be better to be explicit if an 8k buffer is required.
D/dalvikvm(20094): GC freed 6153 objects / 3650840 bytes in 335ms
I/dalvikvm-heap(20094): Forcing collection of SoftReferences for 3599051-byte al
location
D/dalvikvm(20094): GC freed 320 objects / 11400 bytes in 144ms
E/dalvikvm-heap(20094): Out of memory on a 3599051-byte allocation.
I/dalvikvm(20094): "Thread-9" prio=5 tid=17 RUNNABLE
I/dalvikvm(20094): | group="main" sCount=0 dsCount=0 s=0 obj=0x439b9480
I/dalvikvm(20094): | sysTid=25762 nice=0 sched=0/0 handle=4065496
anyone can help me?
I have an app on the market that requires sdk 2.0
I want to rewrite and publish it using 1.6 to find a wider audience.
The question is: if I update my already published app with an sdk downgrade to 1.6 will it then show up to users with phones at 1.6? I know currently the market search shows my app only to those that have 2.0 phones.
How do you access the user's Google Account Id / username in code (pre-2.0)? I am building an application that will call a web service to store data and I want to identify the identity of the person sumitting the data.
If no user identity information available (pre 2.0) how about the ability to access phone identity (pre 2.0).
Thanks in advance.
I'm measuring deltaTime like that:
deltaTime = (System.nanoTime()-startTime) / 1000000000.0f;
startTime = System.nanoTime();
But I'm always getting different float values and because of that my game is stuttering.What can be the problem of that?
09-03 03:51:59.219: D/a(21807): 0.017184043
09-03 03:51:59.234: D/a(21807): 0.016405167
09-03 03:51:59.249: D/a(21807): 0.018071748
09-03 03:51:59.269: D/a(21807): 0.015293334
09-03 03:51:59.284: D/a(21807): 0.016080335
09-03 03:51:59.299: D/a(21807): 0.018669458
09-03 03:51:59.314: D/a(21807): 0.014720625
09-03 03:51:59.334: D/a(21807): 0.01605596
09-03 03:51:59.349: D/a(21807): 0.017086169
I have a strange problem I've come across. My app can write a simple textfile to SD card and sometimes it works for some people but not for others and I have no idea why. Some people it force closes if they put some characters like "..." in it and such. I cannot seem to reproduce it as I've had no troubles but this is the code that handles it. Can anyone think of something that may lead to problems or a better to way to do it?
public void generateNoteOnSD(String sFileName, String sBody){
try
{
File root = new File(Environment.getExternalStorageDirectory(), "Notes");
if (!root.exists()) {
root.mkdirs();
}
File gpxfile = new File(root, sFileName);
FileWriter writer = new FileWriter(gpxfile);
writer.append(sBody);
writer.flush();
writer.close();
Toast.makeText(this, "Saved", Toast.LENGTH_SHORT).show();
}
catch(IOException e)
{
e.printStackTrace();
importError = e.getMessage();
iError();
}
}
In the gui you can go to Settings-About Phone-Firmware Version and get 2.1 (or whatever).
How do I do it from command line (or for a native application that needs to do it in run time ) ?
Hi, sorry for a newbie question..
but "Service" by it's defenision meaning the same as "Remote service" in Android?
and if not, what is the diffrence between them?
thanks,
moshik.
ACTIVITY 1:
Bundle bundle = new Bundle();
bundle.putSerializable("CustomLevelData", LevelCreator.LCLevelData);
Intent i = new Intent(LevelCreatorPopout.this, GameView.class);
i.putExtras(bundle);
startActivity(i);
ACTIVITY 2:
LevelData=(int[][]) extras.getSerializable("CustomLevelData");
ERROR:
E/AndroidRuntime(16220): FATAL EXCEPTION: main
E/AndroidRuntime(16220): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.powerpoint45.maze/com.powerpoint45.maze.GameView}: java.lang.ClassCastException: java.lang.Object[] cannot be cast to int[][]
I have searched but found nothing on 2d INT array passing
I'm working on an app which fetches data from server using JSON. It is working fine in emulator but in my phone, it is giving error and not getting data.
The error comes at this point in JSON Parser....
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);//Error Point
httpEntity = httpResponse.getEntity();
On the third line logcat shows....
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
I have searched a lot but it doesn't help me.
I'm using the Dropbox API. In the sample app, it includes these lines:
// Replace this with your consumer key and secret assigned by Dropbox.
// Note that this is a really insecure way to do this, and you shouldn't
// ship code which contains your key & secret in such an obvious way.
// Obfuscation is good.
final static private String CONSUMER_KEY = "PUT_YOUR_CONSUMER_KEY_HERE";
final static private String CONSUMER_SECRET = "PUT_YOUR_CONSUMER_SECRET_HERE";
I'm well aware of the mantra 'Secrecy is not Security', and obfuscation really only slightly increases the amount of effort required to extract the keys. I disagree with their statement 'Obfustication is good'. What should I do to protect the keys then? Is obfustication good enough, or should I consider something more elaborate?
I was writing a simple test application. There are two radio buttons within the app. There id's are "radio_red" and "radio_blue". I wanted to create an onClickListener event that read the text associated to the button and then returned a basic "Right" or "Wrong" toast.
Here is a sample of the code:
private OnClickListener radio_listener = new OnClickListener() {
public void onClick(View v){
RadioButton rb = (RadioButton) v;
String ans = rb.getText().toString();
String an1 = "";
if (ans.trim() == "Yes") {
ans = "That's Right.";
}
else if (ans.trim() == "No") {
ans = "thats wrong.";
}
else {
ans = "none.";
}
Toast.makeText(v.getContext(), ans , Toast.LENGTH_SHORT).show();
}
So far no joy. Here is my code snippet. I've checked my "main.xml" and the text associated to the buttons are referneced correctly. I added trim to make sure of that. However, all that is ever returned in the toast is "none." What am I missing? Thanks in advance for any help.