Android :: Code Won't Work In New Class / Resolve This?
Aug 31, 2010
The code in the main class works perfekt but i need a other thread but there the code won't work code...
The method create(Context, int) in the type MediaPlayer is not applicable for the arguments (Alarm, int)
and
The method getSystemService(String) is undefined for the type Alarm
View 1 Replies
Sep 1, 2010
I have an application which has 11 different activities. One of these activities is an extension of MapActivity (it is a map for data visualization). To get to this activity the user must first travel through the launch activity, then 3 other activities.
The code to launch the MapActivity is:
CODE:..............
When this is executed I get the following output from the Log:
CODE:.......
I do have the target set to Google APIs, this is an app meant for Android 1.5, and specifies the minsdk to be level 3 in the manifest file. uses-library for maps is also in manifest file.
CODE:..........
I have been at this for almost 2 days now with no results. It seems that there are a lot of people having issues launching a MapActivity from other activities but there are no solutions anywhere.
View 2 Replies
View Related
Jul 8, 2010
I click install on the app brain website after activating fast web installer and nothing happens.
View 4 Replies
View Related
Nov 15, 2009
How can I use sdk to get the package/class name of a specific apk file, eg: I have a test.apk, and I want to know the package name and class name by API when I write a android program.
View 2 Replies
View Related
Sep 2, 2010
I want to serialize my class. I have this code...
I apparently need to implement :
private void writeObject(java.io.ObjectOutputStream out) throws IOException
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
Anyone know what I should do in these function ?? How should I write my Bitmap variable ?Any code examples ? anyone did it ?
View 2 Replies
View Related
Oct 19, 2010
I have a huge codebase. I am not very clear about its design as documents are rear to find.
Is there any tool available to construct the class diagram from the code? I need to know the interactions between the classes and relations between them. If there is any such tool where i can give the entire code as input and get the class diagram as out put, it will be best for my understanding.
View 2 Replies
View Related
Nov 22, 2010
I want to look at the source code for the ListAdapter class without downloading the entire Android source code tree. Is there a way to do that?
View 4 Replies
View Related
Jul 15, 2010
What is the .git file corresponding to ContactsContract.QuickContact class?
View 2 Replies
View Related
Nov 12, 2010
I'm unable to find information about this and unable to find a fix. Every sms my wife or I send gets this error.
View 2 Replies
View Related
Mar 1, 2010
I had a bunch of code in an activity that displays a running graph of some external data. As the activity code was getting kind of cluttered, I decided to extract this code and create a GraphView class:
public class GraphView extends LinearLayout {
public GraphView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.graph_view, this, true);
}
public void start() {
// Perform initialization (bindings, timers, etc) here
}
public void stop() {
// Unbind, destroy timers, } }
Moving stuff into this new LinearLayout-derived class was simple. But there was some lifecycle management code associated with creating and destroying timers and event listeners used by this graph (I didn't want this thing polling in the background if the activity was paused, for example). Coming from a MS Windows background, I kind of expected to find overridable onCreate() and onDestroy() methods or something similar, but I haven't found anything of the sort in LinearLayout (or any of its inherited members). Having to leave all of this initialization code in the Activity, and then having to pass it into the view seemed like it defeated the original purpose of encapsulating all of this code into a reusable view. I ended up adding two additional public methods to my view: start() and stop(). I make these calls from the activity's onResume() and onPause() methods respectively. This seems to work, but it feels like I'm using duct tape here. Does anyone know how this is typically done?
View 4 Replies
View Related
Feb 5, 2010
I am trying to create HTTP connection using AsyncTask class.
Is it possible to create HTTP connection ?
Can you suggest sample source code?
View 2 Replies
View Related
Jul 21, 2010
I set a toggle breakpoint at line 36 of the main class, of APIDemos 8, the debug begins at the OnCreate but never processes another line in the class. Why is that?
Here's the code starting a line 36. Code...
View 1 Replies
View Related
Oct 10, 2013
I'm developing an app that uses google maps, but for some reason it crashed every time I try to call the constructor code from the map class.
main
[HIGH]import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
[Code] ......
View 2 Replies
View Related
Mar 14, 2012
Problem: I have one app that let's you lock the device using Device Administration. One of my users had some conflicts with my app and another. He then removed Device Administration and uninstalled my app, rebooted his phone, and now he cannot access his phone.
He of course cannot use my app to change the password now (since it's uninstalled).
His phone is stock 2.2 LG Optimus V, Virgin Mobile, Rooted.
Question:I'm needing to find a way that my user can now change his lock code.
I need:
1.) to know an internal class (from com.android.internal) that I could use within an app to change the lock code (just like the system settings do).
2.) to know a command I can use with adb shell to remove or change the phone lock code.
3.) to know the location of the file that stores the lock code information.
View 1 Replies
View Related
Feb 16, 2010
Some classes are NOT PUBLIC like android.os.ServiceManager, android.view.IWindowManager, etc, they are implemented in the mobile devices, but not present in the SDK .jar. This is because these classes are private APIs . now please tell me is there any way like compiling source code or importing private class file into android.jar so that i can use this private APIs.
View 3 Replies
View Related
May 10, 2010
I am new in android, I need to send the sms in android, I have tried with the following code, and I have tested in emulator, but I am getting error. I need to know how to send sms, and also please tell me below code will work or not
import android.app.Activity; import android.app.AlertDialog;
import android.app.PendingIntent; import android.content.Intent;
import android.os.Bundle; import android.telephony.gsm.SmsManager;
import android.view.View; import android.view.View.OnClickListener;
import android.widget.Button; import android.widget.EditText;
public class email extends Activity { /** Called when the activity is first created.
*/ public EditText name_text;
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.email);
final EditText to_text = (EditText) findViewById(R.id.to_text); to_text.setOnClickListener(new OnClickListener() { public void onClick(View v) { to_text.setText(""); } } );
final EditText message_label = (EditText) findViewById(R.id.message_text); message_label.setOnClickListener(new OnClickListener() { public void onClick(View v) { message_label.setText(""); } } );
Button send_button = (Button) findViewById(R.id.send_button); send_button.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
String tvstring = to_text.getText().toString();
String bodystring = message_label.getText().toString();
tvstring = tvstring.trim();
if (tvstring.equalsIgnoreCase("Enter The Email-ID")
|| tvstring.equalsIgnoreCase("")) {
AlertDialog.Builder builder = new AlertDialog.Builder(email.this);
builder.setMessage("Please Enter Your Email-ID or Mobile Number")
.setPositiveButton("OK", null).show();
} else if (bodystring.equalsIgnoreCase("Enter The Your Message")
|| bodystring.equalsIgnoreCase(""))
{ AlertDialog.Builder builder = new AlertDialog.Builder(email.this);
builder.setMessage("Please Enter Your Message").setPositiveButton(
"OK", null).show(); }else { sendSMS(tvstring, bodystring); } } } );
} private void sendSMS(String phoneNumber, String message) {
PendingIntent pi = PendingIntent.getActivity(this, 0,
new Intent(this, email.class), 0); SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phoneNumber, null, message, pi, null); } }
View 3 Replies
View Related
May 11, 2009
The Android code on how ContentProviders work, and to me, it looks like any ContentProvider I query actually gets placed entirely in the memory of the requesting application. Are they really stored in the querying application's memory? For some reason I thought the cursors were lazy.
View 7 Replies
View Related
Aug 16, 2009
I am writing an application in which I need to call Master Clear under a specifi condition. But I am getting permission error. AndroidManifest.xml <uses-permission android:name= "android.permission.MASTER_CLEAR" /> Calling Master Clear Code (similar to code present in Settings of Android) ICheckinService service = ICheck inService .Stub. as Interface (ServiceManager.getService ("checkin")); if (service != null) { try { service .masterClear (); } catch (android.os.RemoteException e) { Log.e("MasterClear", "Some Error Here !!");Observation / Error / Output (in DDMS) PermissionDenial : can't invoke masterClear from PID=965, uid = 10019 When I go to menu==>settings==>Application Settings==>Manage Applications ==> <my app> ==> permissions, I dont see any permissions assigned to my app which means the app does not have the permissions. But I have set the permission for master clear ( <uses-permission android:name="android.permission.MASTER_CLEAR" />) in the AndroidManifest.xml but it does not seem to work.
View 3 Replies
View Related
Oct 6, 2010
I follow the instructions exactly on this page (and some of the other tutorials) but they always seem to be missing some key information as they dont work out of the box
I added a bunch of packages that seemed like were missing, but now I'm stuck.
http://developer.android.com/resources/tutorials/views/hello-gridview.html
Description Resource Path Location Type Conversion to Dalvik format failed with error 1 HelloGrid Unknown Android Packaging Problem
And a whole bunch of these for each of the drawable.sample_* references
Description Resource Path Location Type R.drawable.sample_0 cannot be resolved ImageAdapter.java /HelloGrid/src/com/example/ImageAdapter line 51 Java Problem
CODE:....
As you can see I have all the images loaded in the /drawable directory
View 3 Replies
View Related
Sep 22, 2009
I just switched from Ubuntu 8.10 to Ubuntu 9.04 and noticed that Eclipse Content Assist isn't working anymore. I tried the following variations on Ubuntu 9.04: Eclipse 3.4.2 or 3.5 (cleaned / reinstalled) with ADT 0.93 and Android SDK 1.5r3 Using Sun Java 1.6. No combination works. I've reinstalled everything a bunch of times. I have another machine with Ubuntu 8.10 and Eclipse 3.4.2 with ADT 0.91 or 0.93 and Code Assist works for all those. I just refuse to develop without code-assist and I know lot of people would agree with me on that.
View 2 Replies
View Related
May 7, 2010
I had some fairly simple code in my app to invoke Edit Contact activity on a known good contact index that worked in Android 1.6 but is broken for me now in Android 2.1 on the Droid. I built a sample activity/app 'EdCon' to show this:
package com.jbh;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
When I run this on my G1 running 1.6 it works as expected i.e. brings up the Edit Contact screen for the known index and then I can hit BACK to return to "Hello World, EdCon". Code...
View 3 Replies
View Related
Aug 3, 2009
Does anyone have a code example of how I can time bomb an Android application so It will not work after a given date?
I would like to release a "beta" application for testing but would like to make sure it will only work while I have the application officially in beta.
View 3 Replies
View Related
Feb 1, 2010
Everytime i go to send a message it says sms error cause code 34 error class 2. i did a hard reset and it is still happening?
View 3 Replies
View Related
Jun 20, 2013
Got a samsung galaxy s4 and I called att for the unlock and they gave it to me and I tried it but I get network unlock unsuccessful. I tried the free unlock method but u was told to turn on persha. Then when they tell you to type numbers in the diall pad to see what is locked and what is off I get the emergency calls only message what could this be.ciuld be my sim card because I did cut it diwn into a micro sim
View 5 Replies
View Related
Jul 7, 2010
I'm creating a new class, using eclipse "New Java Class" dialog box. I can write the superclass I want (I can't find using "browse" button), but I can't write or select an interface to implement. I click "add" but ther is nothing to select. What I'm doing wrong?
View 4 Replies
View Related
Jul 14, 2010
I'm just getting into Android development, and I have a question about communicating between a receiver class and an activity class. I'm very new to JAVA and Android so I hope I don't sound too stupid. I'm developing an application where I intercept an SMS message and then based on various elements of that SMS I might delete it once it's been saved to the inbox. I have a receiver class that intercepts the txt message, and I am also able to delete messages from my inbox with code in the activity class using a button at the moment. The problem I have is communicating between the receiver class and the activity class where the code to delete a message resides. I tried putting that code directly into the receiver class but as I'm sure most of you already know the BroadcastReceiver class doesn't seem to support what I need to delete messages. I've been searching for an answer to this for a while, but haven't been able to find anything. Honestly I'm not sure I know enough about JAVA and Android to even recognize a solution if I saw it.
View 2 Replies
View Related
Jun 27, 2010
What I want to do, is be able to access the object neoApi inside the Neoseeker class, from its inner class RunningTimer. Now, in my code, you can see what I would think to work, but when I run my application, nothing pops up. Nothing inside my TextView, no Toast, nothing at all. How can I remedy this?
package com.neoseeker.android.app;
import java.util.Timer;
import java.util.TimerTask;
import org.json.JSONObject;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;.......................
View 1 Replies
View Related
Sep 8, 2010
I'm new to Java and android development. In my application I need data which is accessible for a few activities. I've read that a good solution is to use Application class for this. So I use it like this:
public class MyApplication extends Application {
private String str;
public String getStr(){
return str;
}
public void setStr(String s){
str = s;
}
}
and I can access this variable from activity like this:........................................
View 2 Replies
View Related
Oct 8, 2010
I have just started android. I just want to know that how can i call activity class from other java class. i just want to pass class object to activity class.
public class GsonParser extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MagazineThread thread=new MagazineThread();
thread.start();
}
public GsonParser(JsonMagazineParser Obj)
{
}
}
and i am just doing like from other class. GsonParser obj=new GsonParser(this);passing obj to activity class.how can i achieve that.
View 1 Replies
View Related
Dec 27, 2009
I see this square bar code looking image on a lot of android sites. what is this and how does it work? It appears to be somekind of identifier for apps and such.
View 2 Replies
View Related