The Android virtual device (a simulated Android environment) doesn't run very smoothly on my machine. Scrolling and animations in general are quite sluggish. Is that normal?
Forget screenshots, is it posible to capture a video of the running application in android?
Rooted or non-rooted, I don't care, I want atleast 15fps.
Update: I don't want any external hardware. The intent is to make it perfectly portable and every frame is captured within Android OS. If it crosses the boundaries of the app sdk, I'm willing to go to OS level modifications but I would need a starting point.
I would like to show a banner in an Android activity.
The banner should be:
Aligned at the bottom of the layout
Take all the width and have relative height (say 100dip)
Be dismissable
When dismissed the rest of the layout should strech to fill the area that was occupied by the banner.
What's the best way to implement this in Android?
Thanks!
I've reviewed all the similar questions here, but I can't for the life of me figure out what I'm doing wrong.
I've written an application that tries to launch various files, sort of a file browser, when a file is clicked it tries to launch the program based on it's associated MIME type or I want it to present the "Choose Application to Launch" dialog.
Here's the code I'm using to launch:
File file = new File(app.mediaPath() + "/" +_mediaFiles.get(position));
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW);
String extension = android.webkit.MimeTypeMap.getFileExtensionFromUrl(Uri.fromFile(file).toString());
String mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
myIntent.setDataAndType(Uri.fromFile(file),mimetype);
startActivity(myIntent);
This fails and generates a:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///file:/mnt/sdcard/roms/nes/Baseball_simulator.nes }
Now if I install OI File Manager for instance, it opens instead of this error being thrown, and then if I click the same file from within in it, it launches the approriate dialogs.
I have noticed that the MIME type for that particular file fails, but other mime types like .zip do return values.
Am I missing something that when the MIME type is null to call a dialog that lets the user select?
I've tried other variations of launching the app, including not setting the mime type and only using .setData with no success.
The action I want to happen is, a user clicks a file, if it's associated with an application that app launches, if not, the user gets the "Complete action using" dialog with a list of apps.
Thanks for any advice.
I will be releasing two applications soon, one for my company and one for me. Publishing app on my own is straightforward, but I'm not sure which account to use for the company.
What practice do you use in your company?
I only see one solution, creating a special google account like [email protected] shared by the company Android devs.
I have to read *.ics file from the download files by using my application and transfer the data in to Google calendar in android. I am new to android. I need some help to do this.Can anyone help me to do this?
From your experience, to develop an Android software for the marketplace, do i need a real Android device to test my applications or emulator is enough?
I'm planning on doing a application for Android2.1 that changes song every minute (through what I hope exists in Android, "next") for the application using the audio device atm.
So if I have Spotify running in background already, playing music, can I through my program change to the next track?
Let me know if I was unclear about anything.
Thanks in advance!
I have an iPhone app that I'm porting to the iPad. I store several of the ViewControllers in xib's that I would like to resize when they're loaded. For example my startup screen with options is a bitmap that can easily scale up (despite the mis-matched aspect ratio) and I'm trying to figure out where I have ability to resize the image/window during xib loading.
I know that the android plattform is open source. What I am interested in is the share of open source Android apps, thus developers that realease their own apps under a open source license.
Does anybody have an idea, how to get this information?
I have a set of data in a matrix which I would like to display in my iPhone app with all of the rows and columns intact. Everything I can find on the web dealing with "tables iPhone" gives me information on UITableView, which only lets you show a list of items to the user - not an actual table in the HTML sense. What's the best way on the iPhone to display an actual table of data to the user, with column & row headings and table cells?
I would like to tinker with the Android software development kit, and I have found out that it only support 32-bit versions of the Java Platform and Eclipse.
I installed the ia32 Sun Java runtime environment and the 32-bit version of Eclipse. I also used the update-alternatives program to make a java 32-bit preference. Both of these seem to run fine. I also installed the Eclipse android plugins, but my problem lies in the SDK downloaded from Google. When I go to Eclipse preferences and try to tell it about my AndroidSDK location, there are no SDK targets listed.
Has anyone else gotten this running on Ubuntu 9.10 64-bit? Thanks.
Here is a simple code that shows what I think is a bug when dealing with double numbers...
double wtf = 36.76662445068359375000;
id xxx = [NSDecimalNumber numberWithDouble: wtf];
NSString *myBug = [xxx stringValue];
NSLog(@"%.20f", wtf);
NSLog(@"%@", myBug);
NSLog(@"-------\n");
the terminal will show two different numbers
36.76662445068359375000
and
36.76662445068359168
Is this a bug or am I missing something?
if the second number is being rounded, it is a very strange rounding btw...
I have a UIScrollView which contains many UIImageView's UILabel's etc... the labels are well longer that the UIScrollView, but when I run the app, I cannot click and scroll down...
Why might this be?
Thanks
I have a MySql database that stores a timestamp for each record I insert. I pull that timestamp into my Android application as a string. My database is located on a server that has a TimeZone of CST. I want to convert that CST timestamp to the Android device's local time.
Can someone help with this?
Why my java app for android not connect to server ?
I run the aplication in android emulator, and the server wich port 9999 and host 127.0.0.1 in my pc, but just not connect and i think this method isn't good for android app.
It is my source code:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
//Java imports
//import android.util.Log;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class MainActivity extends Activity
{
//Variaveis Interface
private Button ligar;
private Button enviar;
private EditText text1;
private TextView text2;
//Variaveis
static Socket cSocket;
static PrintWriter out;
static BufferedReader in;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Declaração butões
ligar = (Button) findViewById(R.id.ligar);
enviar = (Button) findViewById(R.id.enviar);
text1 = (EditText) findViewById(R.id.text1);
text2 = (TextView) findViewById(R.id.text2);
//Interacao
ligar.setOnClickListener(new OnClickListener(){
public void onClick(View arg0){
connect();
}
});
enviar.setOnClickListener(new OnClickListener(){
public void onClick(View arg0){
out.println("Hello");
text2.setText("");
}
});
}
//Outras Funcoes
public void connect(){
//Funcao ligar
cSocket = null;
out = null;
in = null;
try
{
cSocket = new Socket("127.0.0.1",9999);
out = new PrintWriter(cSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(cSocket.getInputStream()));
text2.setText("Estas conectado com sucesso.");
}
catch (IOException ex) {
//Logger.getLogger(client.class.getName()).log(Level.SEVERE, null, ex);
text2.setText("Erro! Na conexão");
}
}
//
}
Hi all,
To pass data to my webservice, I create an NSDictionary with the objects and keys I need, and use JSONRepresentation to format it nicely so I can post it to my service.
It all worked fine with the previous version where only 2 parameters were required. An array with listitems, and a UDID.
No I also need to pass a version number because we need to provide more data for people with the application at this new version.
Only problem is when I create my JSONRepresentation now, the order of things are all messed up.
NSMutableDictionary *rowDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:arrayDict,@"basketListV2",sharedData.udid,@"UDID",@"1.4",@"version",nil];
It prints out version first, then UDID and then basketListV2.
Anyone know what I can do to maintain the order of my NSDict? I tried both NSDictionary and NSMutableDictionary (Probably doesn't have to do anything with it but for testing purposes I had to try it.)
Thanks in advance.
Lewion
I have some C++ code that I want to make into a static lib for use with Java on the Android platform. Can anyone point me to a resource that tells me how to do this? I am completely new to Java and Android.
I'm following this tutorial: http://huuah.com/android-progress-bar-and-thread-updating/
to learn how to make progress bars. I'm trying to show the progress bar on top of my activity and have it update the activity's table view in the background.
So I created an async task for the dialog that takes a callback:
package com.lib.bookworm;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
public class UIThreadProgress extends AsyncTask<Void, Void, Void> {
private UIThreadCallback callback = null;
private ProgressDialog dialog = null;
private int maxValue = 100, incAmount = 1;
private Context context = null;
public UIThreadProgress(Context context, UIThreadCallback callback) {
this.context = context;
this.callback = callback;
}
@Override
protected Void doInBackground(Void... args) {
while(this.callback.condition()) {
this.callback.run();
this.publishProgress();
}
return null;
}
@Override protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
dialog.incrementProgressBy(incAmount);
};
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new ProgressDialog(context);
dialog.setCancelable(true);
dialog.setMessage("Loading...");
dialog.setProgress(0);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setMax(maxValue);
dialog.show();
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
if (this.dialog.isShowing()) {
this.dialog.dismiss();
}
this.callback.onThreadFinish();
}
}
And in my activity, I do:
final String page = htmlPage.substring(start, end).trim();
//Create new instance of the AsyncTask..
new UIThreadProgress(this, new UIThreadCallback() {
@Override
public void run() {
row_id = makeTableRow(row_id, layout, params, matcher); //ADD a row to the table layout.
}
@Override
public void onThreadFinish() {
System.out.println("FINISHED!!");
}
@Override
public boolean condition() {
return matcher.find();
}
}).execute();
So the above creates an async task to run to update a table layout activity while showing the progress bar that displays how much work has been done..
However, I get an error saying that only the thread that started the activity can update its views. I tried doing:
MainActivity.this.runOnUiThread(new Runnable() {
@Override public void run() {
row_id = makeTableRow(row_id, layout, params, matcher); //ADD a row to the table layout.
}
}
But this gives me synchronization errors.. Any ideas how I can display progress and at the same time update my table in the background?
Currently my UI looks like:
I'm still new to Android, so, I'm still not so familiar with its libraries and APIs.
My first major project is a download manager which supports segmented downloading. I could already download files, but, I still have no idea on how or where to start for segmented downloading.
I have already browsed a lot of threads, but I really couldn't find any article or thread about segmented downloading in Android.
Can anyone please help me?
I am able to create, write and read an SQLite Database in my Android App. I have a copy of the Database that is fully populated with data, and I want to get that data into the App's Database. Is it possible to access my pouplaed database from inside my App? Or can I at least create a copy of the populated database and then use that copy? Or do I need to do a .dump and put all the inserts into the Android code?
Ok so im at my wit's end here. I have tried every imaginable thing to get rid of these errors
heres my code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
/*
//<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
*/
NSInteger row = [indexPath.row];
if (self.nameExcerptPage == nil) {
NameOTWexcerpt *nameExcerptPageDetail = [[nameExcerptPage alloc] initWithNibName:@"NameOTWexcerpt" bundle:nil];
self.nameExcerptPage = nameExcerptPageDetail;
[nameExcerptPageDetail release];
nameExcerptPage.title = [NSString stringWithFormat:@"%&", [TheBookNavTabs objectAtIndex:row]];
Rothfuss_ReaderAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.SecondTableViewController pushViewController:TheBookNavTabs animated:YES];
}
}
and the error appears where it says "NSInteger row = [indexPath.row];
please help! thanks!