How to import BitmapTextureAtlas in Andengine? - android

i added this line.but it gives error.how to import it?
import org.andengine.opengl.texture.atlas.TextureAtlas;

TextureAtlas is an abstract class, try importing
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
or
import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas;
depending on which one you are using
If you using Eclipse and it is configured properly, you should be able to just delete that line and Eclipse will add the correct import statements - at least it does on my system.

Related

Why do android studio show the following warnings while importing?

The following imports are in yellow but no error is thrown, clicking on them takes me to respective class of support-annotations jar as well:
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
Message on hover:
How can I mark code inside android.support.annotation as depricated, it is not my code.
Yellow lines for these imported class signifies annotation class , it is by default yellow in color , therefore there is nothing wrong in your coding .
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import android.preview.support.wearable.notifications.WearableNotifications;

I have a problem with "Stacking Notifications For Android".
So, It was show error when i try to import "import android.preview.support.wearable.notifications.WearableNotifications;"
How to import this class?
Thx for your support.
--
[D]
Looks like some wear class names and packages have changed from the preview to the full sdk:
Since the APIs and package names have changed, the import statements at the top of MainActivity.java need to be adjusted like this:
-import android.preview.support.v4.app.NotificationManagerCompat;
-import android.preview.support.wearable.notifications.WearableNotifications;
+import android.support.v4.app.NotificationCompat;
+import android.support.v4.app.NotificationManagerCompat;

Android Wheel Data picker

I want to use android wheel to choose from some items. I just downloaded some library code from google. I am using it in my app, but it is giving some error.
import kankan.wheel.widget.OnWheelChangedListener;
import kankan.wheel.widget.OnWheelScrollListener;
import kankan.wheel.widget.WheelView;
import kankan.wheel.widget.adapters.AbstractWheelTextAdapter;
import kankan.wheel.widget.adapters.ArrayWheelAdapter;
Giving following error:
The import kankan.wheel.widget cannot be resolved
Can anyone tell me why this error is coming.
Thanks.
I have also used that library in my code and it is working fine.
possibility of error
You can't configure lib properly
In build path add lib
Clean eclipse.
Restart eclipse
import kankan.wheel.widget.OnWheelChangedListener;
import kankan.wheel.widget.OnWheelScrollListener;
import kankan.wheel.widget.WheelView;
import kankan.wheel.widget.adapters.NumericWheelAdapter;
WheelView wheel = getWheel(id);

Add Server classes to android.jar

Right now I am able to get access to the hidden and internal android APIs, but now I want access to things like AlarmManagerService which is in server. I used adb pull system/framework/services.jar changed services.jar to services.zip which unpacked a directory of all the server classes (including AlarmManagerService which I was looking for). My question now is how can I add those server classes to my android.jar file which I can then use in Eclipse?
I hope that makes sense the way I worded it. Let me know if there is any confusion I can clear up.
EDIT: Essentially, when all is said and done, I want to be able to do something like below without any errors:
import com.android.server.AlarmManagerService;
public class TestActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AlarmManagerService ams = new AlarmManagerService(this.getApplicationContext());
ams.setTime(1313);
}
}
ANOTHER EDIT:
I figured this out after looking at all the source code.
Classes like AlarmManagerService just have package visibility which is why it cannot be imported. Some classes are public, but many other com.android.server classes have package constructors so they can't be instantiated.
Here are the com.android.server.* I was able to import and successfully create an object of:
import com.android.server.AttributeCache;
import com.android.server.BootReceiver;
import com.android.server.BrickReceiver;
import com.android.server.ClipboardService;
import com.android.server.ConnectivityService;
import com.android.server.DevicePolicyManagerService;
import com.android.server.DiskStatsService;
import com.android.server.DropBoxManagerService;
import com.android.server.EntropyService;
import com.android.server.InputMethodManagerService;
import com.android.server.LocationManagerService;
import com.android.server.MasterClearReceiver;
import com.android.server.NativeDaemonConnectorException;
import com.android.server.NetStatService;
import com.android.server.NotificationPlayer;
import com.android.server.ProcessMap;
import com.android.server.ProcessStats;
import com.android.server.SystemBackupAgent;
import com.android.server.SystemServer;
import com.android.server.ThrottleService;
import com.android.server.TwilightCalculator;
import com.android.server.Watchdog;
import com.android.server.connectivity.Tethering;
import com.android.server.status.AnimatedImageView;
import com.android.server.status.CloseDragHandle;
import com.android.server.status.DateView;
import com.android.server.status.ExpandedView;
import com.android.server.status.IconMerger;
import com.android.server.status.LatestItemView;
import com.android.server.status.NotificationData;
import com.android.server.status.NotificationLinearLayout;
import com.android.server.status.StatusBarService;
import com.android.server.status.StatusBarView;
import com.android.server.status.StorageNotification;
import com.android.server.status.TickerView;
import com.android.server.status.TrackingPatternView;
import com.android.server.status.TrackingView;
import com.android.server.status.UsbStorageActivity;
android.jar contains only the public API's class files and I think you made changes in 'com.android' package or its internal packages. So to reflect the changes in eclipse you have to add the path explicitly to your service.jar to your project. But remeber this will not reflected at run time, since the emulator or the device you are using have not been updated your changes. And you can't update them by simply modifying the jar file, since the device or emulator uses the image 'system.img' which internally have .dex file as library not the .jar file for internal APIs. To make changes for device/emulator you have to build the whole code and for that you can refer the http://source.android.com/source/index.html.

ADT import of android.media cannot be resolved

i try create my first android application for android 2.1 api level 7 in ADT. I wrote the following line to the default view and eclipse says, that android.media cannot be resolved:
import android.media;
how come, that this doesn't work?
thanks a lot
you cannot import android.media; because it is a package, try using:
import android.media.*;
or
import android.media.MediaPlayer; // if you want to import MediaPlayer
import android.media.Ringtone; // if you want to import Ringtone

Categories

Resources