I have an app that use .jpg
files in drawable folder to show in viewPager.
I want to prevent simply steal my apk drawable files. so before loading them in drawable folder, I changed a unique word in .jpg
file content name it Original
ےطےل Original II* ےى Ducky
to Fake
.
ےطےل Fake II* ےى Ducky
this cause .Jpg
file unreadable.then I load unreadable files to drawable folder.
I need a method that replace
Fake
toOriginal
then send it tomResources
. I have no idea how to do that please explain it step by step!!
class CustomPagerAdapter extends PagerAdapter {
int[] mResources = {
R.drawable.first,
R.drawable.second,
R.drawable.third,
R.drawable.fourth,
R.drawable.fifth,
R.drawable.sixth
};
Context mContext;
LayoutInflater mLayoutInflater;
public CustomPagerAdapter(Context context) {
mContext = context;
mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return mResources.length;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == ((LinearLayout) object);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
View itemView = mLayoutInflater.inflate(R.layout.pager_item, container, false);
ImageView imageView = (ImageView) itemView.findViewById(R.id.imageView);
imageView.setImageResource(mResources[position]);
container.addView(itemView);
return itemView;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((LinearLayout) object);
}
}